我正在使用日期字段和组合框进行选择以加载存储。当商店加载到网格中时,我有一个分页工具栏。到目前一切尚好。
当用户单击下一页时,页面工具栏不会发送来自日期字段的数据。我读到了一些关于baseparams的东西,但这并不起作用。
我使用EXTJS 4.1
这是我的店铺:
NL.commListDetails = new Ext.data.Store({
model: 'stepDetails',
pageSize: 20,
loadMask: false,
sortOnLoad: true,
proxy: {
type: 'ajax',
url: detailURL,
startParam: '',
limitParam: '',
pageParam: '',
reader: {
type: 'json',
root: 'slaevents',
totalProperty: 'slaevents[0].totalCount'
}
},
baseParams: {fromDate:NL.startDate},
autoLoad: false
});这是分页工具栏
bbar: Ext.create('Ext.PagingToolbar', {
store: NL.commListDetails,
displayInfo: true,
displayMsg: 'Displaying record {0} - {1} of {2}',
emptyMsg: "No records to display",
}),我需要发送fromDate,endDate和寻呼。在NL.startDate和NL.endDate中都可用。当我点击下一页时,如何发送此信息?
发布于 2012-08-06 20:18:24
没有存储的baseParams配置。要发送额外的参数,您应该使用ajax代理的extraParams配置。
proxy: {
type: 'ajax',
....
extraParams: {fromDate:NL.startDate},
..
},另外,在创建存储时定义参数将意味着它们是静态的,因此如果您修改日期字段或组合框,它们将不会更改……
因此,修复方法是侦听combobox或datefield上的change事件,并重置额外的参数:
change: function(this,value){
NL.commListDetails.getProxy().getExtraParams().comboName = value;
}编辑我站着更正。有一个baseParams,但它在elementloader上,只有当load被直接调用时才会调用它,我认为使用loadPage的分页工具栏不是这种情况。在这一点上我可能错了,但我使用的是extraparams,它工作得很好。
https://stackoverflow.com/questions/11827879
复制相似问题