View Full Version : Load tree nodes from different URLs in Tree panel

13 Feb 2013, 3:16 AM
Extjs 4.1

Hi, here is what I want help to achieve:

1- Load parent nodes by ajax request to a json file e.g. URL of the parent nodes json file is parentNodes.json


2- Once the parent nodes loaded then on parent node expand (when user clicks to expand the parent node) need to load some other nodes as children of the this parent node by ajax request to a different json file.

e.g. URL for Node1 children Node1/node1Childern.json


e.g. URL for Node2 children Node2/node2Childern.json


please note that the "path" in parent node used as the path of the json file for child nodes.


14 Feb 2013, 9:12 PM
You could listen to the beforeload event and change the url

18 Feb 2013, 12:07 AM
Thanks for the answer,

In the beforeload event handler I still can't get the expanded node to know what URL to change to, could you please post some example code showing how to capture the node, and I think I need to access the tree store proxy URL config to change it (Ext.data.proxy.Ajax what I'm using).