继承Ext.data.Store

来源:互联网 发布:社交网络头像 编辑:程序博客网 时间:2024/05/20 20:20

继承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);
 }
});

0 0
原创粉丝点击