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

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

问题描述

您好,我想在combobox搜索。它的工作,但搜索只在当前页面我使用分页与搜索我需要搜索所有页面,而不是当前页

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. 您的商店需要设置 pagination

您的服务器需要处理基于从商店的代理接收的参数正确地分页。代理将发送诸如?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},...] code>

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

尽管文档,combobox中的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天全站免登陆