Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use gridfilters Plugin AND programmatically clear/set the filters?

Tags:

extjs

extjs5

In my app (ExtJS 5.0.1) I'm trying to use a grid with the gridfilters Plugin AND shortcut buttons (and also from a tree) with custom/hardcoded fiters.

I was able to partially mimic the set and clear of the filters, but I'm having the following problems:

1- When I set a filter via grid.filters.store.addFilter(..) the style of the column title doesn't change to bold, and the grid filter checkbox stays unchecked.

2- Same as 1 but reversed... first I set the filter on the column, when I clear the filter the column stays bold, but in this case the checkbox is cleared (as it should).

3- When I'm using summary feature 'sometimes' the total is not updated

So, my question is: Is there a proper way to programmatically set/clear filters mimicking the gridfilter Plugin ?

I've put a minimal Fiddle to simulate this.

https://fiddle.sencha.com/#fiddle/akh

Best Regards, Ricardo Seixas

like image 294
rseixas Avatar asked Nov 27 '25 05:11

rseixas


1 Answers

Just use filter instance on column:

var column = grid.columnManager.getColumns()[0];
column.filter.setValue('J');
column.filter.enable();

Working sample: http://jsfiddle.net/3be0s3d8/7/

like image 172
Krzysztof Avatar answered Nov 29 '25 23:11

Krzysztof