我们有一个ExtJS V4.1组合框,我们已经将其绑定到店,并设置其pageSize的配置如下:如何解决ExtJS 4.1 Combobox pageSize错误?
var myStore = Ext.create('Ext.data.Store', {
model: 'User',
remoteFilter: true,
remotePaging: true,
autoLoad: true
proxy: {
type: 'ajax',
url: '/users.json',
reader: {
type: 'json',
root: 'users'
}
},
pageSize: 50, // <= store pageSize
});
Ext.create('Ext.form.ComboBox', {
fieldLabel: 'Choose',
store: myStore,
queryMode: 'remote',
displayField: 'Name',
valueField: 'Id',
pageSize: 20 // <= combobo pageSize
});
由于documentation says组合框的pageSize
财产应当用于过滤发送到AJAX查询服务器时为queryMode='remote'
。但是我们看到的却是相反的情况,它仅用于在组合框底部显示分页工具栏(文档的第一条评论如此)。
但是,在这种特定情况下,我们真正需要的是覆盖商店的pageSize
属性,并使组合框的pageSize
属性用于过滤ajax请求。
我们如何在ComboBox中实现/扩展这样的功能?我们如何覆盖商店中的组合框pageSize
?
谢谢尼尔,好主意。我解决的是通过覆盖它的商店来为非共享商店。但是我认为你的解决方案适用于共享和非共享商店。我对吗? – 2013-05-08 04:27:44
应该可以为 – 2013-05-08 04:51:48