Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Leonard on Apr 29, 2008 04:40
open dhtmlx forum
refreshing tree

Hi,

I'm using your pro version of dhtmlxtree. I'm using a dynamic XML for the data on my tree, and i have a button where it updates the image of the tree folderClosed.gif to my own image. and I want to reload the tree after updating it. I tried smartRefreshItem, smartRefreshBranch, refreshItem and I also tried to reload the XML again with tree.loadXML() but it didn't refresh or request a new xml data from my server. any idea how?

Thanks.
Leonard
Answer posted by Support on Apr 29, 2008 06:28
The issue can be caused by XML caching ( pretty common in case of IE )
You can try to resolve issue by using
    tree.preventIECaching(true)
this command will force adding of random elements to URL, which must prevent caching.

Also if you want to fully reload tree you can use
    tree.deleteChildItems(0); //necessary to clear old structure
    tree.loadXML(url);
Answer posted on Apr 29, 2008 06:57
i also tried:     tree.setItemImage(tree.getSelectedItemId(),"xpshare.gif","xpshare.gif")
 and it didnt work. i put tree.preventIECaching(true) before setItemImage() but still not working.
Answer posted by Support team on Apr 29, 2008 08:10
This is a really strange issue, because the same code used in online sample
    http://dhtmlx.com/docs/products/dhtmlxTree/samples/appearance/tree_text_image.html?un=1209482867000
and all works fine.