Sha256: 1c567968a0438ad9b32b1f83f12728f8f5e97253bad8b3fbd4f9383a74ebdce8

Contents?: true

Size: 713 Bytes

Versions: 5

Compression:

Stored size: 713 Bytes

Contents

Ext.define('TM.model.Assignee', {
  extend: 'Ext.data.Model',

  fields: [
    { name: 'id', type: 'int' },
    { name: 'name' },
    { name: 'class_name' },
    { name: 'parent_id', type: 'int' }
  ],

  proxy: {
    type: 'rest',
    url: '/assignees.json',
    reader: {
      root: 'assignees',
      totalProperty: 'total'
    }
  },

  getId: function(detailed) {
    if(detailed) {
      return this.get('class_name') + '-' + this.get('id');
    } else {
      return this.get('id');
    }
  },

  getParentId: function(detailed) {
    if(this.get('parent_id') && detailed) {
      return this.get('class_name') + '-' + this.get('parent_id');
    } else {
      return this.get('parent_id');
    }
  }
});

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
task-manager-0.1.7 app/assets/javascripts/task-manager/extjs/app/model/Assignee.js
task-manager-0.1.6 app/assets/javascripts/task-manager/extjs/app/model/Assignee.js
task-manager-0.1.5 app/assets/javascripts/task-manager/extjs/app/model/Assignee.js
task-manager-0.1.4 app/assets/javascripts/task-manager/extjs/app/model/Assignee.js
task-manager-0.1.3 app/assets/javascripts/task-manager/extjs/app/model/Assignee.js