I am getting an error while trying to run the javascript code for client side events. "The object does not support this property or method."
var ignoreEvents = false;
function handleNodeEvent2(){
if (ignoreEvents) return;
ignoreEvents = true;
var node = window.event.node;
if (window.event.eventName == "ONLOADCHILDRENFINISHED") {
setChildrenCheckBox(node, node.IsChecked);
}
else if (window.event.eventName == "ONCHECKED") {
setChildrenCheckBox(node, true);
if (allSiblingChecked(node)) {
setParentCheckBox(node, true);
}
}
else if (window.event.eventName == "ONUNCHECKED") {
setChildrenCheckBox(node, false);
setParentCheckBox(node, false);
}
ignoreEvents = false;
}
function allSiblingChecked(node){
var nodes = node.ParentNode == null ? node.TreeView.Nodes : node.ParentNode.Nodes;
var allChecked = true;
for(var i = 0; i < nodes.length; i++) {
if (!nodes[i].IsChecked){
allChecked = false;
}
}
return allChecked;
}
function setParentCheckBox(node, value){
var parentNode = node.ParentNode;
if (parentNode == null) return;
if (parentNode.IsChecked != value)
parentNode.CheckBoxChange();
if (!value || allSiblingChecked(parentNode))
setParentCheckBox(parentNode, value);
}
function setChildrenCheckBox(parentNode, value){
for(var i = 0; i < parentNode.Nodes.length; i++) {
var node = parentNode.Nodes[i];
if (node.IsChecked != value)
node.CheckBoxChange();
setChildrenCheckBox(node, value);
}
}
The error is on the line "node.CheckBoxChange();"