nestedSortable icon indicating copy to clipboard operation
nestedSortable copied to clipboard

[relocate event] to be able to pass arguments of the relocate function the new and the old position of the item.

Open twicejr opened this issue 11 years ago • 3 comments

From DrSchizo : One nice addition would be to pass as arguments of the relocate function the new and the old position of the item. For instance, my script is saving the new location in real time, and not only after clicking on a "save" button. I managed to do it by exporting the toArray output and comparing it with a saved version, but it could have been not much easier to do, especially since the previous and current index and parent id should be retrieved in the script just before triggering the relocate event (at least, once the bug will be fixed).

twicejr avatar Aug 25 '14 19:08 twicejr

+1

TheSin- avatar Dec 22 '15 15:12 TheSin-

+1 Also - there should be a way to prevent the movement. Like you drag an item, call some ajax save on drop and if it fails for some reason - there should be a way to revert the tree to it's old state, so it stays in sync with the DB state.

lllopo avatar Feb 18 '16 10:02 lllopo

Btw., what is the point of the relocate event, when original jquery ui sortable start and stop events are working quite fine, incl. the preventDefault ?

lllopo avatar Feb 18 '16 11:02 lllopo