ExtJs Treepanel with N number of nodes (treeview with infinite loop in child node)

Last week I was working on ExtJs to create a TreePanel control, main challenge in this task was, in tree view level of child nodes was not fixed (N number of child’s).
Requirement was to get JSON response from REST service and generate dynamic data structure for tree view as mentioned in below image.

ExtJS treepanel

ExtJS treepanel

To create this functionality I have used JavaScript recurring function and ExtJs data model, so I thought lets share it with everyone.
Please check out code mentioned below and feel free to ask questions or further explanation.

Index.html File Code  (Make sure to add library file references)

app.js File (Contains main application logic) 

 

To download sampe JSON response, Click here!

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *