[Extjs6] 使用extraParames引數給Ext.data.Store新增額外的引數
阿新 • • 發佈:2019-01-06
定義store
注意extraParames引數的使用。
Ext.define('Test.store.Contacts', {
extend: 'Ext.data.Store',
model: 'Test.model.Contact',
autoLoad: true,
pageSize: 35,
autoLoad: {start: 0, limit: 35},
proxy: {
type: 'ajax',
api: {
read : 'Test/view.action',
create : 'Test/create.action' ,
update: 'Test/update.action',
destroy: 'Test/delete.action'
},
extraParams: {
ddCode: 0
},
reader: {
type: 'json',
root: 'data',
successProperty: 'success'
},
writer: {
type : 'json',
writeAllFields: true,
encode: false,
root: 'data'
},
listeners: {
exception: function(proxy, response, operation){
Ext.MessageBox.show({
title: 'REMOTE EXCEPTION',
msg: operation.getError(),
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
}
}
}
});
修改引數的方法:
//修改引數的值
Xxxx.getStore().getProxy().extraParames.ddCode = value;
Xxxx.getStore().load();