extJs之store

Ext.define('Business.store.businessRequest.BrUnitRuleStore',{
extend:'Ext.data.Store',
alias : 'widget.brUnitRuleStore',
pageSize:BusinessCommon.PAGE_NUM,
// pageSize:2,
pageNum:1,
condition:'',
model:'Business.model.businessRequest.BrUnitRuleModel',
autoLoad:false,
proxy: {
type: 'ajax',
url : 'rule/queryAllRules',
code:'',
actionMethods : {
read : 'POST'
},
reader: {
type: 'json',
root: 'resultList',
totalProperty:'totalCount'
}

},

//排序方式

sorters : [ {
property : 'code',
direction : 'asc'

} ],

//在加载数据前要传的参数

listeners : {
beforeload : {
fn : function(store, options) {
var brUnitId = Ext.getCmp('brUtinTabPanel_br').selectBrUnitId;
Ext.apply(store.proxy.extraParams, {
'pageNum' : this.pageNum,
'pageSize': this.pageSize,
'code':this.condition,
'unitId':brUnitId
});
}
}
}
});

你可能感兴趣的:(ExtJs)