Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by VIKAS MANHAR on Jan 25, 2008 09:24
open dhtmlx forum
DHXTree Item Movement along with Data Processor

Hi ,

I am using multiple items movement in one shot usng loop...

var list=[ ...array of ids ... ];
for (var i=0; i<list.length; i++){
tree.moveItem(list[i],....
myDataProcessor.serverPorcess="url..."
}

and after the loop i send data using
myDataProcessor.sendData();


this generate no of requests and fired them at once...

this is not working as manual update funcationality is working in DataGrid (ie second request will be fired after the completion of First).

How to implement that?



Answer posted by Stanislav on Jan 25, 2008 16:03
In case of dhtmlxtree the updates has more complex logic, because tree need to maintain correct hierarchy - child items may be updated only after parent ones updated , so dataProcessor allows data saving only one-by-one, without possibility to do all-at-once saving.


myDataProcessor.setUpdateMode("off")

var list=[ ...array of ids ... ];
for (var i=0; i<list.length; i++){
    tree.moveItem(list[i],....
    myDataProcessor.setUpdated(list[i],true);
}

myDataProcessor.sendData();