您的位置:首页 > Web前端 > JavaScript

[Extjs6] 使用extraParames参数给Ext.data.Store添加额外的参数

2017-10-06 00:00 423 查看

定义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();
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: