extjs过滤列标题文本字段中的网格数据

时间:2014-04-30 22:14:36

标签: extjs panel extjs4.2

我试图理解网格标题过滤器在列标题文本字段中的工作原理。

复制厨房水槽示例,无法查看列标题内的文本字段。

http://jsfiddle.net/srikanthradix/ghzD9/2/

我定义了我要过滤的公司专栏

{
                text: 'Company (Filter)',
                sortable: false,
                dataIndex: 'company',
                width: 120,
                locked: true,
                editor: {
                    xtype: 'textfield'
                },
                items: {
                    xtype: 'textfield',
                    flex : 1,
                    margin: 2,
                    enableKeyEvents: true,
                    listeners: {
                        keyup: function() {
                            var store = this.up('tablepanel').store;
                            store.clearFilter();
                            if (this.value) {
                                store.filter({
                                    property     : 'company',
                                    value         : this.value,
                                    anyMatch      : true,
                                    caseSensitive : false
                                });
                            }
                        },
                        buffer: 500
                    }
                }
            }

并添加了基本设置,如setpath,requires和features

Ext.Loader.setPath('Ext.ux', 'http://cdn.sencha.com/ext-4.2.0-gpl/examples/ux/');

Ext.require([
    'Ext.grid.*',
    'Ext.data.*',
    'Ext.util.*',
    'Ext.state.*',
    'Ext.ux.grid.FiltersFeature'
]);

在网格内

 features: [{
            ftype: 'filters'
        }],

你能否建议我是否遗漏了其他任何东西?

1 个答案:

答案 0 :(得分:-1)

你不喜欢这个插件:Grid MultiSearch Plugin?它非常易于使用,不需要额外的听众编码。

相关问题