Posted 1 May 2019, 12:11 pm EST - Updated 3 October 2022, 8:04 pm EST
Hello,
I am using Wijmo flex grid pure js.
How to clear the filter on the column?
We are showing applied filter details as text above the grid with a close button.
On click of button(X) we need to clear/remove that particular filter from the grid.
Below is the sample code we are useing to show applied filter on the grid.
MyGridFilter.filterChanged.addHandler(function (s, e) {
var filterDefinition = JSON.parse(MyGridFilter.filterDefinition);
var FilterText = ‘’;
for (var i = 0; i < filterDefinition.filters.length; i++) {
var _CurFilter = filterDefinition.filters[i];
var FilterName = _CurFilter.binding;
var FilterValuesObj = Object.keys(_CurFilter.showValues);
var FilterValues = FilterValuesObj.join(“, “);
FilterText = FilterText + ((FilterText != ‘’) ? “|” : “”) +
“” + FilterName + “(” + FilterValues + “) X ”;
}
$(”#AppliedFilters”).html(FilterText);
});