问题
My task is to put an image on the extjs grid column header whenever filter is applied in that column. When filter is cleared remove the image from the grid column header.
How to achieve this in extjs 3?
回答1:
In ExtJS 3.4 when filter is active on a column .ux-filtered-column
class is added to the header cell. Easiest way is to add custom style for this class.
回答2:
GridView has a reference to the grid it is used by. Hence, you could use this.grid.store.isFiltered()
to check whether store is filtered.
You probably want to perform such check in the listener function bind to datachanged
event of grid's store:
initComponent: function() {
...
this.grid.store.on('datachanged', this.yourDesiredFunction, this);
...
}
yourDesiredFunction: function(store) {
if (store.isFiltered()) {
// do your stuff
}
}
回答3:
custom style for class .ux-filtered-column works good. However .ux-filtered-column is not getting added to the header cell if it is grouped header grid.
回答4:
i had the same problem.The .ux-filtered-column was not effective.But in that I added background image,which worked finally.
来源:https://stackoverflow.com/questions/13739034/how-to-track-in-gridview-whether-filter-is-applied-or-not-in-extjs