使用分页 extjs 在组合框中搜索 [英] Search in combobox with pagination extjs

查看:21
本文介绍了使用分页 extjs 在组合框中搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我正在尝试在组合框中进行搜索.它正在工作,但仅在当前页面中搜索我也在使用分页和搜索功能,我需要在所有页面中进行搜索,而不仅仅是当前页面

Hello i'm trying to do search in combobox.It's working but search only in current page i'm using pagination with search too i need to search in all pages not current page only

任何建议

{
    xtype: 'combo',
    fieldLabel: 'Organization Id',
    name: 'company_id',
    displayField:'name_en',
    valueField:'id',
    store: Ext.create('UserApp.store.PicklistList', {
        autoLoad: true,
        fields: ['id', 'name_en', 'name_se'],
        proxy:{
            type:'ajax',
            api: {
                read:'picklist/listitems'
            },
            reader: {
                type: 'json',
                root: 'root',
                successProperty: 'success'
            },
            extraParams:{
                table :'table_name'
            }
        }
    }),
    editable: true,
    autoSelect: false,
    selectOnFocus:true,
    typeAhead:true,
    minChars:2,
    queryMode: 'local',
    mode: 'local',
    pageSize: 25,
    width:370,
    allowOnlyWhitespace: false,
    regex: /[a-zA-Z0-9]+/, // avoid to empty data only
})

推荐答案

  1. 您的商店需要设置 分页

您的服务器需要根据从商店代理收到的参数正确处理分页.代理将发送查询字符串参数,例如 ?page=1&start=0&limit=25,并且您的服务器只需要返回 25(例如)条记录和一个总参数.

your server needs to handle pagination correctly based on the parameters received from the store's proxy. The proxy will send up querystring parameters like ?page=1&start=0&limit=25, and your server needs to return only 25 (for example) records and a total parameter.

{"total":101,"data":[{model data}, {model data}, ...]}

尽管有文档说明,但组合框中的 pageSize 属性实际上是一个布尔值,如果为 1 或更大,则打开分页.

despite the documentation, the pageSize property in combobox is actually a boolean, turning pagination on if 1 or greater.

这篇关于使用分页 extjs 在组合框中搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆