Saving Re-Ordered Tasks with DataProcessor

Hello,

I’m using dataprocessor to send values to server.

I have gantt.config.order_branch = true; enabled meaning tasks can be dragged and re-ordered.

When I re-order a task a dataprocessor event fires, however the data it gives me seems to be random and seems useless for storing order of tasks in the database.


_target is not the position that I dragged the task to. Sometimes _target also says next:2.

Hope someone can help me make sense of this?

Thanks,
Tim

target is ID of item, in which position new item was dropped.

target:2 - row must take the place of row with id = 2
target:next:2 - row must take the place next to row with id = 2

Because Tree structure on client side can be opened and closed the real index value has not much sense ( it will change for different state of branches ), so client sends ID of item, which is consistent.

“next” prefix is necessary for the case when we drop row as last one ( in such case it can’t take position of some other row )

You can check the “order” function in the connectors/db_common.php.
This code gets index of target row from database, after that it updates index of source row and indexes of other rows if necessary.

Hi Stanislav,

Thank-you for the tips.

I’ve had a look at db_common.php but cant find the “order” function you mentioned.

Could you please give me a line number as this would be very helpful to look at.

Thanks,
Tim

Check the next link

github.com/DHTMLX/connector-php … n.php#L665

I am experiencing the same problem. Once the drop operation completes, every other operation that follows returns an error. Were you able to find the culprit?

Please be sure that you are using latest connector files.
If the issue still occurs, check the server side response for the problematic operation, is it a correct text or an empty response? In a second case you can enable logs for a connector and get error description from the log file.