I am newbie extJs user. I have using tree panel with checkbox and i want to uncheck the parent node when the children node is not all checked. below is my code, hope you can help me guys, i dont know what to do here.
the structure of my treepanel is something like this:
- parentnode1
- sub-parentNode1.1
- child1.1
- child1.2
- child1.3
- subparentNode1.2
- child2.1
- child2.2
- sub-parentNode1.1
- parentnode2
- subparentNode2.1
- child2.1.1
- subparentNode2.1
var treeCheck = new Ext.tree.TreePanel({
//some code here
});
//event here
treeCheck.on('checkchange', function(node, checked) {
if(node.hasChildNodes()==true) {
node.eachChild(function(n) {
n.getUI().toggleCheck(checked);
});
} else {
if(!checked) {
var _parentNode = node.parentNode;
//i dont know what to do here...
//specifically, i want to uncheck the parent node and subparent node
//when the children/child node is unchecked
}
}
});