Posted 29 July 2024, 4:09 pm EST
Hello,
I am trying to disable filter for selected columns in the grid. I so that by setting the flexFridFilter.FilterType to 0 explicitly in the code. However, I see that it is getting reset when the data loads into the grid and it defaults to flexFridFilter.FilterType =3. I was wondering what needs to be done to amke the grid the filter definition set in the code always. Here is a example of my code
html:
<wj-flex-grid-filter
#filter
(filterChanged)=“onFilterChanged(flexGrid, $event)”
(editingFilter)=" this.editingFilter(filter, $event) "
(initialized)=“this.initializeFilter(filter)”
>
TS:
@ViewChild(‘filter’, { static: true })
flexGridFilter!: wjcGridFilter.FlexGridFilter;
this.dataService.Getdata().Subscribe((result)=>{
this.griddatasource = new wjcCore.CollectionView(this.accountsList);
this.disableFiltersForSSPUser();
}
);
disableFilters() {
const columns = [‘col C’, ’ col D’];
columns.forEach((column) => {
const col = this.flexGridFilter.grid.columns.getColumn(column);
const cf = this.flexGridFilter.getColumnFilter(col, true);
cf.filterType = 0;
});
this.flexGridFilter.apply();
this.flexGridFilter.grid.refresh();
}