Categories | Question details Back To List | ||
refresh dhtmlxtree without using the dataprocessor for deleted items hi, I do modify things from my tree without using the dataprocessor (using a personal ajax request). Then, I want to refresh my tree using this code: tree.smartRefreshItem(itemId) The problem is that the dataprocessor execute a query to delete items that are no longer in the new data tree after the refresh, as I have already deleted them manually. Is it possible to prevent these queries to run? sorry for my poor english. Guillaume Answer posted by Alex (support) on Jul 24, 2009 02:42 Hello, could you please expain in details what should be do to re-create the issue. Answer posted by guillaume on Jul 24, 2009 03:10 To recreate the problem you must: 1) initializing a tree (dynamic loading) with data loaded from a database 2) make changes to the database (without using the dataprocessor) 3) try to see changes in the tree. (as if we initialize the tree again, but retaining the open nodes) I can not do this. What is the best way to do? Answer posted by Alex (support) on Jul 24, 2009 03:44 Hello, in case of dynamic loading the only way to reloaded the whole tree -this is to loaded the tree again and restore the open state (dhtmlxtree_xw.js extention): tree.saveOpenStates(); Answer posted by guillaume on Jul 24, 2009 06:29 thank you for this response, it helps me. I ask me if it's possible to do less brutal, since I know exactly which nodes have been changed. I have write this code : //item1 and item2 are the 2 parents node i need to refresh tree.smartRefreshItem(item1); tree.smartRefreshItem(item2); But sometimes I have a conflict, when the first refresh of the elements is not finished and there are nodes in common with the second, I have a error (duplicate content or XML error) I
bypassed this error by adding timeouts but I do not find safe : //with timeouts contacts_tree.smartRefreshItem(item1); setTimeout(function(){ tree.smartRefreshItem(item2); }, 500); The ideal would be to run the second smartRefreshItem when the first is finished, without using a timeout. Is there a way to do this? thank's Answer posted by Alex (support) on Jul 24, 2009 07:06 There is onXLE event that is called after xml loading. loadingH = contacts_tree.attachEvent("onXLE",function(){ Answer posted by guillaume on Jul 24, 2009 07:13 thank you, that's exactly what I needed. your support is very efficient! thank you |