PDA

View Full Version : Store with no Model?



hermann.s
16 Sep 2013, 2:31 AM
Hi,

in all examples there is always a model defined with fields, etc. which is later used in a store.

Is it possible to define the fields directly in the store and not have to define a model?


Ext.define('Base.GridPanel', {
extend: 'Ext.grid.Panel',
xtype: 'gridpanel',

collapsible: true,
store :
{
autoLoad: true
},

constructor: function(id, title, store, columns)
{
this.id = id;
this.title = title;


this.store = store;
this.columns = columns;


this.callParent();
}
});


I'd like to pass the store as an argument in the constructor as you see above.

PulpMysteryFan
16 Sep 2013, 7:25 AM
Yes, Ext.data.Store has a fields:[], configured exactly like what's used in a model declaration.

See: http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.data.Store-cfg-fields

hermann.s
16 Sep 2013, 7:44 AM
Thank you.