【问题标题】:Extjs 3.2 Grid Filter Not workingExtjs 3.2 网格过滤器不工作
【发布时间】:2014-03-18 09:20:50
【问题描述】:

我是 extjs 新手,我在网格过滤器上使用 extjs3.2。过滤器在每个标题下正确显示,但它不是过滤器

var store = new Ext.data.Store({
                    id : 'user',
                    autoDestroy: true,
                    url: 'site/view.action',
                    proxy : proxy,
                    reader : reader,
                    writer : writer, // <-- plug a DataWriter into the store
                                        // just as you would a Reader
                    autoSave : false,


                // <-- false would delay executing create, update, destroy
                // requests until specifically told to do so with some [save]
                // buton.
                });

这是我的 GridFilter 代码

 var filters = new Ext.ux.grid.GridFilters({
                     encode: true, // json encode the filter query
                     local: false,
                    filters:[
                 {type: 'string',  dataIndex: 'sapid'},
                 {type: 'numeric', dataIndex: 'orgid'},
                 {type: 'string',  dataIndex: 'companyCode'}

                             ]});

这是我的 GridPanel 代码

 var grid = new Ext.grid.GridPanel({
                        store : store,
                        disableSelection: true,
                        id : "documentsGrid",
                        columns : [{
                                    header : "SAP ID",
                                    width : 120,
                                    sortable : true,
                                    dataIndex : 'sapid',
                                    filter: {
                                        //type: 'numeric'  // specify type here or in store fields config
                                    },
                                    filterable: true,
                                    renderer: function (value, metaData, record, rowIndex, colIndex, store) {
                                         return  getToolTip(value, metaData, record, rowIndex, colIndex, store);
                                    },
                                    editor : {
                                        xtype : 'textfield',
                                        allowBlank : true
                                    }
                                    },
     plugins: [editor,filters],

有什么问题我无法理解

请帮忙

谢谢

【问题讨论】:

    标签: extjs extjs3


    【解决方案1】:

    由于您指定过滤器不是本地过滤器,这意味着您必须具有服务器端过滤器。如果您只想在客户端进行过滤,请指定 local : true。

    还要确保过滤器中使用的 dataIndex 确实引用了您商店中的字段,并且没有遗漏任何内容。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-11-16
      • 2020-06-12
      • 2012-02-23
      相关资源
      最近更新 更多