View Full Version : how to create TreeNode in Ext JS4

22 Mar 2012, 11:02 AM
There was a class TreeNode in Ext JS3. I donot see the same class or equivalent in Ext JS4. Some where in Ext JS4 documention it is mentioned that, "you could simulate TreeNode by model instance and decorating it with NodeInterface". I appreciate, if some one can expand on this or give some coding example to create TreeNode equivalent in Ext JS4.

22 Mar 2012, 1:18 PM
A tree node in Ext 4 is basically your Model. Your model class will be magically decorated with the NodeInterface class. If you open this source file you'll get the hang of it. Adding a tree node to a tree:

treeStore.getRootNode().appendChild({ foo : 'bar' })