Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Jay on Jun 06, 2008 07:04
open dhtmlx forum
dhtmlXTree: Get child nodes from server through AJAX call

Hi,

Is it possible to retrieve the child nodes of the dhtmlXTree node when its is expanded (clicking on + image) through AJAX call?

Basically we have a huge amount of data to be displayed on server and for that retrieving whole data at one shot and rendering it as tree is not a solution as on the selection of any node considerable amount of data will be displayed on a content panel on the right side of the tree.

To achieve this we are thinking of fetching only 1st level of tree items on page load and depending upon the user's selection of the node, corresponding child nodes will be fetched from the server using AJAX and also the data to be displayed on the right side of the tree.

Is this possible using dhtmlXTree? If so please let me know how this can be done. Any help on this will greatly be appreciated.

Cheers !!!
- Jay
Answer posted by Support on Jun 06, 2008 09:53
>>to retrieve the child nodes of the dhtmlXTree node when its is expanded
Dynamical loading -
    http://www.dhtmlx.com/docs/products/dhtmlxTree/samples/loading_processing_data/tree_dyn_loading.html?un=1212772155000

to enable you need
    - set server side script by tree.setXMLAutoLoading(...)
    - in data XML , provide "child" attribute for elements which need to loaded from server by separate requests.

http://www.dhtmlx.com/docs/products/dhtmlxTree/doc/dyn_loading.html#dyntree

The default package contain samples for PHP, please inform if you need a sample for some different language.