I have two sortable lists that contain work orders. The second list is Route , and the first is a list of all work orders that have not been added to the Route list. The idea is that the user drags work orders in Route in a certain order, rebuilding work orders to create a route that the employee will follow.
My problem is managing the position of new work orders being dragged into the Route list. Is there an easy way to handle updating the positions of all list items (on the side of the things database via ajax calls) as new items are added?
A little more information for clarity ...
When the Route list is empty (work orders have not yet been added), the user simply drags the new work order to the empty list, an ajax call made to save the information (in the base records on the server) as a Route and only a Route Item .
When a user drags the second order of work into the Route list, I want to determine whether the new order of work will become first in the list or second, and then update all the information (server side) for all elements in the list, respectively. Everything becomes very complicated when I want to add a new work order to Route , which already has 30 work orders.
Is there an easy way to do this or is it just a matter of coding a decent amount of jQuery and backend functions to manage this? I hunted for a network for solutions, but I canβt find anything so definitive.
Garfonzo
source share