diewland
diewland

Reputation: 1915

If I initial ExtJS tree without children, How to add them later?

I try to add children to root node with this command.

tree.root.appendChild({ text : 'xxx' });

It doesn't work for no-children tree.
In other way, It work when I do this with tree that already initial with children node.

Thank you.

Upvotes: 0

Views: 1707

Answers (1)

ojibi
ojibi

Reputation: 26

Please use below command.

Ext.getCmp('treepanelId').getRootNode().appendChild({ text : 'xxx' });
Ext.getCmp('treepanelId').doLayout();

Upvotes: 1

Related Questions