继承Ext.data.Store稍微有点复杂,这个也是在写gridPanel的时候经常需要把Store用独立的js编写,松耦合,易维护。
Ext.define("定义的store的名字", {
extend : "Ext.data.Store",
pageSize : 10,
model : '定义的model的名字',
constructor : function(config) {
config = config || {};
Ext.apply(this, config);
var me = this;
me.proxy = {
type : 'ajax',
actionMethods : {
read : 'POST'
},
extraParams : {},
url : '',
reader : {
root : 'items',
totalProperty : 'total'
}
};
this.callParent(arguments);
}
});