PDA

View Full Version : add column filter in grid



ilnurgi
8 May 2015, 3:11 AM
Hello.

I have grid, and i need add column filter in columns.
But grid does not I design, I can only subscribe to the event beforerender, and tweaking.

Please tell me how to add a filter to the grid column?


And I need to add a filter in the column, similar of searchfield.
User enters text, and it should be a button, a cross, which resets the filter, similar searchfilter.

Thanks, sorry for my bad english

jmin91
8 May 2015, 4:36 AM
I think I understand what you mean and while I don't have experience with adding fields inside column headers nor do I know if it's possible or not but what I have done in the past is add a toolbar to the grid. Inside that toolbar add your fields and button. Aside a click event to the Search button and within that event, filter the store according to your search fields.

MiamiCoder
8 May 2015, 10:11 AM
The beforerender event has the grid as its first argument. You can try to get the columns by invoking getColumns. From there, get the column where you need to add the filter, and use the column's items property to add the filter. Let me know how it goes.

Gary Schlosberg
14 May 2015, 3:30 PM
Here's an example that might help:
http://docs.sencha.com/extjs/4.2.1/#!/example/grid/infinite-scroll-with-filter.html