Hi,
I have the following code that runs on the check event of the Kendo TreeView CheckBox. If the node is checked, it disables and unchecks all of its children nodes. If the node is unchecked, it simply enables the children. I would like to perform similar functionality in the document.ready section, where I need to go over all the tree nodes, and disable all children of any checked node. While it seems simple, I cannot wrap my head around the right traversal method for this to work.
Please advise.
Thanks.
Alex.
function
onCheck(e) {
var
chbx = $(e.node).find(
'.k-checkbox input'
).filter(
":first"
);
var
state = chbx.is(
':checked'
);
if
(state) {
$(e.node).find(
".k-group input"
).prop(
'checked'
,
false
);
$(e.node).find(
".k-group input"
).prop(
'disabled'
,
true
);
}
else
{
$(e.node).find(
".k-group input"
).prop(
'disabled'
,
false
);
}
}