Dec 17, 2013, 7:18 AM
Check child nodes treepanel
Hi, i need help for Check child nodes in treepanel. I have a problem for check child nodes. i already try this http://forums.ext.net/showthread.php...ll=1#post95193
And i got this error
And i got this error
var onCheckChange = function (node, checked) {
if (!this.locked) {
this.locked = true;
if (node.hasChildNodes()) {
node.cascade(function (childNode) {
childNode.set("checked", checked);
});
}
var nodoPadre = node.parentNode;
if (nodoPadre != null) {
if (checked == false) {
nodoPadre.set("checked", false);
var nodoPadre2 = nodoPadre.parentNode;
if (nodoPadre2 != null) {
nodoPadre2.set("checked", false);
}
} else{
var todosCheck = true;
nodoPadre.cascade(function (childNode2) {
if ((childNode2.data.checked == false) && (nodoPadre.data.text != childNode2.data.text)) {todosCheck = false; }
});
if (todosCheck == true) { nodoPadre.set("checked", true); }
var nodoPadre2 = nodoPadre.parentNode;
if (nodoPadre2 != null) {
var todosCheck2 = true;
nodoPadre2.cascade(function (childNode3) {
if ((childNode3.data.checked == false) && (nodoPadre2.data.text != childNode3.data.text)) {todosCheck2 = false; }
});
if (todosCheck2 == true) { nodoPadre2.set("checked", true); }
}
}
}
this.locked = false;
}
};
Thanks