i saw from the Kendo UI for Jquery Kendo Grid page is able to achieve the indetermindate state for checkbox but i cant seems to find how do i do it?
1 Answer, 1 is accepted
0
Accepted
Georgi
Telerik team
answered on 06 Jul 2022, 12:09 PM
Hello Benjamin,
Thank you for your question!
I assume that you want to achieve indeterminate state for the main checkbox in the header of the grid. Indeed, it is possible and you can do that by using the change event of the Grid. Below, I am sending you the modifications you can try:
functiononChange(arg) {
let grid = $("#grid").data("kendoGrid");
let selectedRowsCount = grid.select().length;
let pageSize = grid.dataSource.pageSize();
if(selectedRowsCount > 0 && selectedRowsCount < pageSize){
$(".k-grid-header .k-checkbox").prop("indeterminate", true);
} else{
$(".k-grid-header .k-checkbox").prop("indeterminate", false);
}
}
The following Dojo demonstrates the full implementation of the above logic:
Let me know if this works for you or if you have any questions.
Regards,
Georgi Slavov
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.