组合框分页工具栏不响应页面大小

Combobox paging toolbar doesn't respond to page size

我在使用组合框从数据库中选择项目时遇到了一些问题。 由于加载了 100 多个项目,我使用组合框底部的分页工具栏。 现在,如果页面大小设置为 5 或 50,分页工具栏会根据页面大小显示第 1 页,共 20 页或第 1 页,共 2 页,但组合框显示所有 100 个项目,只需将它们复制到下一页,就像根本没有设置页面大小一样。 我尝试了几件事,但似乎没有任何效果。 怎么了?

{
    xtype: 'combobox',          
    queryMode: 'local',
    valueField: 'id',
    fieldLabel: 'Description SKU',
    name: 'id_fk',
    pageSize: 5,                
    width: 400,
    padding: 5,
    store: Ext.create('Ext.data.Store',
            {
                fields: ['id','key item','description'],
                autoLoad: true, 
                pageSize: 5,                        
                proxy:
                {
                    type: 'ajax',
                    url: 'items/load',
                    reader:
                    {
                        type: 'json',
                        root: 'data'
                    }
                }
            }),
    tpl: Ext.create('Ext.XTemplate',
            '<tpl for=".">',
                '<div class="x-boundlist-item">{key item} - {description}</div>',
            '</tpl>'),

    displayTpl: Ext.create('Ext.XTemplate',
                            '<tpl for=".">',
                                '{key item} - {description}',
                            '</tpl>'
                            )
}

当发出加载商店的请求时,它将传递值为 5 的 pageSize 查询参数。

但是,返回结果时是否考虑此参数取决于您的服务器端服务。

编辑:这是分页组合框的示例:http://docs.sencha.com/extjs/4.1.3/#!/example/form/forum-search.html

如果您在 Web 开发控制台上打开网络选项卡,您将看到正在触发的请求,您可以查看查询参数。您可以根据需要发送其他人,但这对于基本寻呼来说应该绰绰有余了。

发送的查询参数如下:

limit - 由 "pageSize" 参数设置(默认为 25)

start - 要返回的第一条记录(从 0 开始,使用工具栏上的 prev/next 按钮按 pageSize 递增)

page - 我们所在的页面(从 1 开始,使用工具栏上的 prev/next 按钮 decremented/incremented 乘以 1)

查询 - 组合框中的文本。

编辑 2: 您还应该在服务器的响应中返回 "totalProperty",其中包含结果总数。这将适当地更新工具栏(例如,您在第 x 页,共 y 页)。默认情况下,预期的 totalProperty 为 "total"。当您查看提供的示例中的代码时,您可以看到这一点。