Is it possible to cancel row reorder event programmatically?
Is it possible to cancel row reorder event programmatically?
JaviNott
Posts: 12Questions: 2Answers: 0
With the new version 1.3.3 of row reorder extension I have seen that some events have been added. I wonder if it's possible to cancel the event under certain conditions (i.e. target destination is not allowed due to app logic) and all the changes done being reverted.
I am currently checking if new order set by user is allowed in a function that handles the row-reorder event, but I don't know how to revert changes done.
Thanks
This question has accepted answers - jump to:
Answers
Hi,
There isn't I'm afraid. By the time
row-reorder
tiggers, it is too late to cancel the action. This is the place that a new event would need to go.I'm in the middle of some other stuff at the moment, but I can look at adding that.
Allan
While its not exactly what you are looking for take a look at this example from this thread. Maybe it will give you some ideas until Allan can add a cancel action.
Kevin
I've added this ability row cancel the row reordering from the
row-reorder
event in this commit. It will be in the nightly shortly.With that you just need to add
return false;
to therow-reorder
event handler if you want to cancel the reorder action, and the table will revert to its state from when the drag started.Allan
Great!
Thanks for the support.
Regards,
Javi
Just a quick question, when will be released next stable version with this change included?
Its currently the only change in RowReorder since the last release, so I'll probably give it a few weeks. Or do you need it in a release urgently?
Allan
Hi Allan,
I have solved it by reloading the data again when that scenario happens. But as I am going to upgrade current version we are using of RowReorder for our next week release it would be great to have it, if no, it doesn't matter I will go prod with the workaround.
I have also modified locally the clone method following instructions in this thread as I have parent and child rows I need to drag and drop together. Is there any future plan to handle child rows with RowReorder extension?
Thank you very much for your support. I really appreaciate it.
Javi
Not at this time.
I'll hopefully get the release done on Friday.
Allan
Great Allan,
Thank you very much indeed!
Hi Allan,
Do you have any estimated date for the release?
I don't want to hurry you up, it's just to plan my own release.
Regards,
Javier
Hi Javier,
Really sorry that slipped past me! That's it down now . The NPM packages are just building.
Allan
Thanks Allan!!