//注意红字部分。由于分页的时候,需要带上原始的参数。所以需要监听事件上,配置参数
var store = new Ext.data.Store({
pageSize : 20,
fields : [ {
name : 'id',
type : 'string'
}, {
name : 'name',
type : 'string'
}, {
name : 'type',
type : 'string'
} ],
proxy : {
type : 'ajax',
url : 'test!loadData.action',
extraParams : {
type: ‘testType’
},
reader : {
type : 'json',
root : 'data'
}
},
listeners : {
"beforeload" : function() {
Ext.apply(store.proxy.extraParams, {
limit : 20,
type: ‘testType’
});
}
}
});