Hey. I found a bug with the actual ExtJS 5.0.0.970. 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:

http://ift.tt/1hUWWMp


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:



Code:



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) {
continue;
}

filter = header.filter;


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