javascript - Common model in ExtJs 4 -
one ???? I have a few grids that have the same fields, I want to create a normal model and extend it from below:
Ext.define ('my.model.MyModel', {extend : 'Ext.data.Model', field: [{name: 'fieldA'}, {name: 'fieldB'}]}); Ext.define ('my.model.MyModelA', * Expand: 'my.model.MyModel', Field: [[// How do I add extra columns to sub-class?}]}); And also for the grid.
Just add additional fields. The model will be detected during the definition time.
Ext.define ('A', expand: 'Ext.data.Model', field: ['name']}); Ext.define ('B', {extension: 'a', field: ['age']}); console.log (B.getFields ());
Comments
Post a Comment