PDA

View Full Version : Models and lazy instantiation



mx_starter
22 Oct 2013, 1:32 AM
Can someone explain me why it is not possible to lazy instantiate a Model during a Store definition, for example, it is impossible to use:


store:
{
model: { fields: [{name: 'name1'}, {name: 'name2'} ...] }
}


and the following must be used instead:




Ext.define('storeModel',
extend: 'Ext.data.Model',
fields: [{name: 'name1'}, {name: 'name2'} ...]
);


store:
{
model: 'storeModel'
}

droessner
22 Oct 2013, 4:51 AM
You need to specify just the fields on the store. For example:



store: {
fields: [{name: 'name1'}, {name: 'name2'} ...]
}