I am trying to check all child nodes of a node if this is checked.
Added a listener
tree.addListener('expandnode', this.onTreeNodeExpand, this);
Function
onTreeNodeExpand: function (node) {
if (node.hasChildNodes()) {
node.eachChild(function (n) {
var checked = n.parentNode.ui.isChecked();
if (checked != undefined && checked)
{
n.getUI().toggleCheck(checked);
}
});
}
}
Since I have Async tree node, all child records will be loaded on demand and first time when the node is expanded I get false for this statement
if (node.hasChildNodes()) // returns false
It think "expandnode" event is called same time while Async is in progress
.
How can I capture a event where after async data is loaded, check if this node is checked and set all child nodes to checked?
Environment: EXTJS 3.4
Since, I didn't get much help on EXTJS doc for this scenario, I have handled it as below.
All my Async calls for child records will go through a function, in that ajax success function once the data is loaded, I called another function to set the check box based on parent node.