Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Bill Jindrich on Jul 21, 2008 13:29
open dhtmlx forum
dhtlmXtree: minimizing the XML data file size

We are using the dthmlXtree for the site navigation for a web site. The pages in the site will all reside under a certain virtual path on the site, however, the pages may reside in sub-directories underneath that virtual path. For example:

http://domain.com/x/y/z/virtual folder/page1.html
http://domain.com/x/y/z/virtual folder/page2.html
http://domain.com/x/y/z/virtual folder/subfolder1/page3.html
http://domain.com/x/y/z/virtual folder/subfolder2/page4.html

Is there any way to keep the fixed virtual path externalized (http://domain.com/x/y/z/virtual folder/ in the above example) so that it is not a part of the XML tree data for each item in the tree? Since our tree is fairly big, we're trying to get the XML tree data file as small as possible.

Also, do you have any other suggestions for minimizing the size of the XML data file? It also seems inefficient to repeat "im0="leaf.gif" im1="folderOpen.gif" im2="folderClosed.gif"" for every item in the tree. Is there any way to just define the icons to apply to every item in the tree, thus removing the need to have the optional im0, im1 and im2 atrributes in the XML file?
Answer posted by Support on Jul 22, 2008 02:30
>>nefficient to repeat "im0="leaf.gif" im1="folderOpen.gif" im2="folderClosed.gif"
Those attrbiutes are optional, tree will use default images, if attributes not specified

>>any way to just define the icons to apply to every item in the tree
    tree.setStdImages("leaf.gif","folderOpen.gif","folderClosed.gif")

>>Is there any way to keep the fixed virtual path externalized
    You can store any additional data in userdata sections

<tree>
    <userdata name="path">http://domain.com/x/y/z/virtual folder/</userdata>
    ... other tree data ....

In js code it can be accessed as
    tree.getUserData(0,"path")