I callled root.appendChild() to add couple children to a treepanel root and called root.expand() to expand the tree but the child nodes did not show until I click on any of the the sort button on the header. Is there any property I need to set to show the child node programmally?
Thanks for help.
The following is the code:
tree.getRootNode().removeAll();
var root = tree.setRootNode({
PRTNUM:'root',
id: 'treeRoot',
leaf: false
});
for (var i = 0; i < result.data.length; i++) {
var rec = result.data[i];
var node = root.appendChild({
PRTNUM: rec.PRTNUM,
DESC: rec.DESC,
icon: this.convertTypeToIcon(rec.TYPE),
id: rec.PRTNUM,
leaf: true
});
}
root.expand();