View Full Version : [FIXED] GridFilters with custom filters

3 Jun 2014, 1:54 AM
Hey. I found a bug with the actual ExtJS I have a grid with the gridFilters plugin. Additional to this the grid has some buttons on the top bar which can set a special filter. These filter has an own name which doesn't match to any column in there. My backend to the store has the knowledge what to do with this special filter. When I now want to remove the special filter the grid filters plugin throw an error:


To reproduce the error just click the first button "set filter" and then the button "removeFilter" and you should see the error "TypeError: columnManager.getHeaderByDataIndex(...) is null".

I already found the error. The error is found in the GridFilters::onFilterRemove. It's just a missing check whether the column exists before using ".filter" on it. My overwrite for this is:

Ext.define('GridFiltersFix', {
override: 'Ext.grid.filters.Filters',

onFilterRemove: function (filterCollection, list) {
// We need to know when a store filter has been removed by an operation of the gridfilters UI, i.e.,
// store.clearFilter(). The settingValue flag lets us know whether or not this listener has been
// reached by a filter operation (settingValue === true) or by something outside of the UI
// (settingValue === undefined).
var len = list.items.length,
columnManager = this.grid.columnManager,
i, item, header, filter;

for (i = 0; i < len; i++) {
item = list.items[i];

header = columnManager.getHeaderByDataIndex(item.getProperty());
if (!header) {

filter = header.filter;

if (!filter.settingValue) {
// This is only called on the filter if called from outside of the gridfilters UI.

3 Jun 2014, 2:31 AM
Thanks for the report! I have opened a bug in our bug tracker.