Tree: DataProcessor - supplied data not enough

Hello,



i am using tree with data processor. Up to this all works fine.



in the update routine i will get information about :



tr_id = request->get_form_field( ‘tr_id’ ). "node ID

status = request->get_form_field( ‘!nativeeditor_status’ ).



tr_order = request->get_form_field( ‘tr_order’ ). " node sequence on the level

tr_pid = request->get_form_field( ‘tr_pid’ ). " parent ID

tr_text = request->get_form_field( ‘tr_text’ ). " node text(label)



This is not quite comfortable. I need also the old parent id of the moved node, because the node can have more than one parents

from the logically point of view.



(Think for example of an UNIX-filesystem, there a folder can have symbolic links).



The only solution seems so far, that I on the drag&drop event handler trying to get the actual parent and appending it on the

dataprocessor url like:



tr_oid = tree.getParentId(id);

dataProcessor.serverProcessor = ‘update.do?mode=copy&tr_oid=’ + tr_oid;



Is there any other solution available?



Best regards,

Stefan



You can store any additional info in userdata, all userdata records sent to server side

tree.attachEvent(“onDrag”,function(id,…){

tree.setUserData(id,“tr_oid”,some);

});



Hello,



ok. This is a liitle bit more elegant than my solution :slight_smile:, but does it not makes sense to deliver this information as standard?



Best regards,



Stefan

Technically this info can be obtained on server side, in most cases we can get current parentID value of item in DB ( or in any other storage ) and made all necessary procession before setting parentID to new value.
While the parameter can be useful it not really necessary for update operations.
More than that, dataprocessor with auto-update mode as “off”, allows to drag the same row multiple times - as result the “old parent ID” become not so useful


OK, the last sentence is quite correct and makes no sense, when autoupdate is off. So we can close this thread. Solution was provided.



Thank you very much one time more :slight_smile:,



Stefan