I am trying to solve a problem with a functionality I need to implement for a grid. This grid should use a custom "filter" which extends from "Ext.ux.grid.FiltersFeature", this component works fine since it works for other grids I implemented. the problem is that the grid I want to implement now, does not load it columns at the first moment like the previous I implemented; this grid has a controller which uses a "reconfigure" method to create the columns based on a "store".
For instance:
grid.reconfigure(store, cols);
I've seen many examples on how to add individual filters and so on, but they use the "ftype: "filters", I do need to use my "ftype: mycustomfilter" specifically. Any idea on how can I do this? I tried everything, but nothing seems to be working and I am stucked with this.
Here's some of my code:
Portion of code in the Controller:
if (refreshGrid) {
var cols = this.createGridColumns();
//This is the method that loads my column based on the store
//(which I retrieve from Ajax request)
grid.reconfigure(store, cols);
oldStore.destroyStore();
} else {
this.mergeFn.call(this, values, store);
grid.view.refresh();
}
What I tried to do is to add a feature after reconfiguring the grid:
grid.reconfigure(store, cols);
//Then I add this portion of code:
grid.features = [{
ftype: 'customfilterfeature',
autoReload: false,
local: true,
filters: [{type: 'list', dataIndex: 'activity'},
{type: 'list', dataIndex: 'datetime'}]
}]
Does anybody have an idea on how can I achieve this? Because this is not working at all, the filter is not being displayed. Any help will be really appreciated. Thanks in advance.