Preselect Checkboxs which are already selected and stored in

Hi,



User select a particular child node(checkbox) and that will be stored in the DB. When the user comes back to the tree, the selected child node,parent node and root node should be preselected and the tree should be in opened and visible (collapsed mode).



Please let me know how to accomplish this. Help will be appreciated.



Thanks in advance.

You may define selected|opened nodes in XML

      
selected attribute force selection of item after XML loading
open attribute force item opening after loading

or make the same effect by JS code

tree.selectItem(id);   //force selection
tree.openItem(id);   //force opening
tree.focusItem(id);   //adjust scrollbars so item will be visible for sure
   


Hi,



Thank you very much for the reply. It worked.



But i noticed a strange behavoir. I have downloaded 1.6 standard version.



After loading the xmltree many times (approx 15 times), the tree not displaying at all. I don’t see any error.



I clearted the cache,temp folder,restarted the server it didn’t work.



This is what i did to get it work:



1. Loaded the old versions of (working) dhtmltree.js and dhtmlcommon.js, test.jsp(which loads the tree) . Tested.



2. Then loaded the new version 16 dhtmltree.js and dhtmlcommon.js, test.jsp(which loads the tree) and it worked this time.



This is strange. any idea?



 



 



 


Not sure, the problem may be caused by some caching effect.



If problem occurs only in IE - you can try to use
          tree.enableIEImageFix(true)
it will resolve problem with image caching in IE which can cause some weird problems.



If problem still occurs for you - please provide any kind of sample where problem can be reconstructed ( you can send it directly to support@dhtmlx.com )

Thanks for the reply.