Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Alexander on Jun 12, 2009 07:16
open dhtmlx forum
dhtmlxtree enableMercyDrag + dhtmlxdataprocessor question

Hello,

I'm using dhtmlxtree 1.6 pro version, when I copy a not empty node with mercydrag e.g. this node have 3 children, i get a 4 ajax request to server from dhtmlxdataprocessor 1- root node, 2,3,4 - subnodes(children). On the server side i use PEAR NestedSet library so i need only one request for handle it - only root node without children. Please advise is it possible to force dhtmlxdataprocessor to make only one request with main node only or recommend some other solution.

Thank you.
Regards,
Alexander.
Answer posted by Alex (support) on Jun 12, 2009 08:18

Hello, 

you can try to use the following approach

tree.attachEvent("onDrag",function(sid,tid){
  dp.setUpdateMode("off");
  return true
})
tree.attachEvent("onDrop",function(sid,tid){
  for(var i = dp.updatedRows.length-1; i>=0 ; i--){
  if(dp.updatedRows[i]!=sid) dp.setUpdated(dp.updatedRows[i],false)
  }
  dp.setUpdateMode("cell");  
})
Here dp is dataprocessor object. This approach deletes child nodes from "updated" array - so, only parent is send to the server.

Answer posted by Alexander on Jun 16, 2009 09:58
Thank you much!