如果采用MVC模式定义了Store和对应的model,分别为:
Ext.define('hcx.store.ContactStore',{
extend : 'Ext.data.Store',
xtype : 'hStore',
requires : ['hcx.model.Contact'],
config: {
model : 'hcx.model.Contact',
sorters : 'lastName',
grouper : {
groupFn : function(record){
return record.get('lastName')[0];
}
},
data : [
{ firstName: 'Tommy', lastName: 'Maintz' },
{ firstName: 'Rob', lastName: 'Dougan' },
{ firstName: 'Ed', lastName: 'Spencer' },
{ firstName: 'Jamie', lastName: 'Avins' }
]
}});