DhtmlxTree On Demand loading

Now we require to implement the Dhtmlx Tree which is taking more time to display data. we are fetching 400 hundred rows from database through stored procedure. The below sample data converted into tree structure by calling the below recursive function from page load.Where we have to make change in order to implement the on demand.Please help us to resolve this constraint ASAP.





function recTreeView(intPID,strTagName,bindContent)

{



var strVal=‘’;

var t = XmlReq.responseXML.documentElement.getElementsByTagName(strTagName);

for(var intCnt=0;intCnt<t.length;intCnt++)

{

if(fnGetNodeText(t[intCnt].getElementsByTagName(“PARENTID”)[0])==intPID)

{

strVal +=‘<item id="’+fnGetNodeText(t[intCnt].getElementsByTagName(“ID”)[0])+‘"’;

strVal +=’ text="‘+fnGetNodeText(t[intCnt].getElementsByTagName(“NAME”)[0])+’">‘;

strVal +=recTreeView(fnGetNodeText(t[intCnt].getElementsByTagName(“ID”)[0]),strTagName,bindContent);

strVal +=’';

}

}

return strVal;

}



var tree;

function PageOnLoad()

{





tree = new dhtmlXTreeObject(“treeboxbox_tree”, “100%”, “100%”, 0);

tree.setImagePath(“…/dhtmlxTree/codebase/imgs/csh_bluebooks/”);

tree.setOnClickHandler(tonclick);

tree.enableDragAndDrop(true);

tree.loadXMLString(“<tree id="0">”+fetchTreeView(“Table”)+“”);

}



function fetchTreeView(nodeName,bindContent)

{

return recTreeView(“0”,nodeName,document.getElementById(“hidTreeValue”).value);

}



function fnGetNodeText(xmlObjNode)

{

//if(window.ActiveXObject)

if(_isIE)

{

//alert(xmlObjNode.text);

return xmlObjNode.text;

}

else

{

//alert(“fnGetNodeText Value:” +xmlObjNode.childNodes[0].nodeValue);

if(xmlObjNode&&xmlObjNode.childNodes.length>0)

return xmlObjNode.childNodes[0].nodeValue;

else

return “”;

}

}







ID    NAME     PARENTID



16    Application     0

17    3rd Party Applications    16

18    Compatibility issues    17

19    Unable to install    17

20    Unable to launch    17

21    Unable to uninstall     17

22    Unexpected behavior (crash)    17

23    Inbox MS Vista Applications    16

24    Accessories (Calculator, Paint…)    23

25    Action Center (Win 7)    23

26    Bluetooth file transfer wizard    23

27    Calendar    23

28    Contacts    23

29    DVD Maker    23

30    Fax and Scan    23

31    Games    23

32    Magnifier    23


There are different ways to improve performance. For example dynamic loading or Smart XML Parsing (the last one is available only in PRO edition).


Please, see details in the article:


dhtmlx.com/dhxdocs/doku.php?id=d … erformance


Thanks alex.  Could you give some example for this tree structure.



Regards,



amal.


The examples of xml structures for all components can be found here dhtmlx.com/docs/products/doc … index.html