1
votes

I have implemented grid filters in Extjs 3.4, but now I am migrating to extjs 4.1. Can anyone show me how to implement grid filters in extjs 4.1?

(As a new user, I am unable to upload an image to show an example)

2

2 Answers

0
votes

The best way is to define a column component.

Ext.define('Ext.ux.grid.MyColumn',{

extend: 'Ext.grid.column.Column',

alias: 'widget.mycolumn',

childEls: [
    'headerEl', 'titleEl', 'filterEl', 'triggerEl', 'headerTextEl', 'filterTextEl'
],

renderTpl:
    'change it , and make your own TPL',

initComponent: function () {
// change or declare new data if you want.
// me.callParent(arguments);
// I have modified lot. so, I skip initComponent of Ext.grid.column.column
me.superclass.superclass.initComponent.call(this); // directly call parents parent class.
}

});


USAGE : 
columns: [
    {
         xtype: 'mycolumn',
         itemId: 'sfsfsfsfsf', text: 'My filter column'
    }
]
1
votes

Please refer following link.

http://www.sencha.com/forum/showthread.php?150918-Grid-Header-Filters

Second option is filter in menu, and this is available in extjs 4.1 examples.

http://docs.sencha.com/extjs/4.1.3/#!/example/grid-filtering/grid-filter-local.html

Third option is filter row.

http://www.sencha.com/forum/showthread.php?128154-FilterRow-for-Ext-JS-4-Grids

One of these link will guide you to the right path.

Regards.