I am using a kendo ui treeview control on an asp.net mvc page. When a cancel button is clicked I want to uncheck all the checked boxes in the treeview. The following is my code.
function cancel() {
var treeView = $("#treeview").data("kendoTreeView"),
myNodes = treeView.dataSource.view();
for (var i = 0; i < myNodes.length; i++) {
var children = myNodes[i].children.view();
if (children) {
for (var j = 0; j < children.length; j++) {
if ((typeof children[j].checked !== undefined) && (children[j].checked)) {
//children[j].prop('checked', false);
children[j].attr('checked', false);
}
}
}
}
}
Whether I use either children[j].prop('checked', false); or children[j].attr('checked', false); I am getting "object doesn't support property or method" error.
Thanks