Common tree manipulations, like drag-n-drop (including d-n-d between trees), removing item, inserting item, or updating item's label, can be simultaneously reflected in server database now (since v.1.3) using dataProcessor module.
Main features of this module are:
Updated|deleted items' data is sent to the server to the specified URL (we call it serverProcessor). serverProcessor should return simple XML of the specified format to let the tree know about successful or not successful processing. All necessary after-save procedures will be done automatically.
To enable this feature, the user should do the following:
<script src="../codebase/dhtmlxdataprocessor.js"></script> <script> ... tree.init(); myDataProcessor = new dataProcessor(serverProcessorURL); myDataProcessor.init(treeObj); // tree object to assign dataProcessor to, mandatory </script>
The mandatory parameter for dataProcessor is:
Using server-side dataProcessor, the user should bare in mind the following:
<data> <action type='insert/delete/update' sid='incomming_node_ID' tid='outgoing_node_ID'/> </data>
In the above mentioned snippet, incomming_node_ID and outgoing_node_ID may be different for insert action only, but they are equal for other actions.