Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by guillaume on Nov 26, 2008 05:19
open dhtmlx forum
how to disable dataprocessor in dhtmlxtree

hi,
i want to disable dataprocessor for many actions in my tree (delete from the visible tree on the page, but do nothing in the database)
how can i do that ?

thanks
Answer posted by Support on Nov 26, 2008 05:45
There is no native solution, but the next code can be used 

var old=dp.setUpdated;
dp.setUpdated=function(){};

...any code here will not trigger dataprocessor ...

dp.setUpdated=old;

where dp - instance of dataprocessor
Answer posted by guillaume on Nov 26, 2008 08:34
thanks for the answer, it's work !
but when it delete an item during the setUpdated function is redefine, the node don't disapear in the tree. he is just crossed. is it normal ? how can i do to make it invisibe ?
Answer posted by Support on Nov 26, 2008 08:44
You can use the next code snippet for item deleting

tree.setUserData(id,"!nativeeditor_status","deleted"); //mark item to be ignored by dataprocessors logic
tree.deleteItem(id);
Answer posted by guillaume on Nov 26, 2008 08:50
ok, it's perfect.

thanks