Sha256: a4edff81ca0e96405abf005e6383d862c91cadee9e62aba2ebdc55e00c4b6ed3

Contents?: true

Size: 668 Bytes

Versions: 4

Compression:

Stored size: 668 Bytes

Contents

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

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

  proxy: {
    type: 'rest',
    url: '/callbacks',
    reader: {
      root: 'callbacks',
      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

4 entries across 4 versions & 1 rubygems

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