We're using Kendo Grids for our .NET Core application. We display checkbox lists in the column headers so the user can filter in the Kendo Grid. The problem is that the items in these checkbox list are not sorted (even if we pass sorted items to it).
We tried to add a fix by adding the following FilterMenuInit client side event to try to sort the checkbox list column header items
function onFilterMenuInit(e) {
var filterMultiCheck = this.thead.find("[data-field='" + e.field + "']").data("kendoFilterMultiCheck");
if (filterMultiCheck) {
filterMultiCheck.container.empty();
filterMultiCheck.checkSource.sort({ field: e.field, dir: "asc" });
filterMultiCheck.checkSource.data(filterMultiCheck.checkSource.view().toJSON());
filterMultiCheck.createCheckBoxes();
}
}
The fix is causing the following issue:
VM4956:3 Uncaught TypeError: Cannot read properties of null (reading 'Id')
at eval (eval at filter (kendo.min.js:9:168981), <anonymous>:3:25)
at r.filter (kendo.min.js:9:169113)
at r.process (kendo.min.js:9:171128)
at init._queryProcess (kendo.min.js:9:190070)
at init.query (kendo.min.js:9:191247)
at init._query (kendo.min.js:9:191778)
at init.filter (kendo.min.js:9:192662)
at init._filter (kendo.min.js:9:918467)
at HTMLFormElement.r (website.min.js:14:21692)
at HTMLFormElement.dispatch (website.min.js:14:57771)
This is happening on the Kendo side. Is this a bug? Is there an alternative way to sort these checkbox list in the column headers?