Posted 31 October 2024, 10:23 am EST - Updated 31 October 2024, 10:28 am EST
I have a FlexGrid in which I have enabled the FlexGridFilter. In its initializeFilter callback, I am configuring my boolean columns with a data map that shows Yes and No instead of the defaults.
const map = new DataMap([
{ value: true, caption: "Yes", },
{ value: false, caption: "No", },
], "value",
"caption");
// Now, for each of the boolean columns, apply the filter options to them.
for (let c = 0; c < filter.grid.columns.length; c++) {
if (filter.grid.columns[c].dataType === DataType.Boolean) {
var colFilter = filter.getColumnFilter(c);
if (colFilter) {
colFilter.dataMap = map;
}
}
}
By default, the filter popup had a bunch of different conditions:
I have an new requirement, which is to limit the condition filters for boolean columns to only allow the Equals and Not Equals operators. How can I accomplish this?
I tried adding a dataMap to the conditionFilter in initializeFilter but it didn’t seem to have any effect.