I’m trying to implement dragable sorting and saving the order to mysql using php and jQuery.
Here’s the scenario.
Say, I have 3 items listed as Messages, Disputes and Services.
-
Messages:
msg1
msg2
msg3… -
Disputes:
disp1
disp2
disp3… -
Services:
ser1
ser2
ser3…
the information shown above is coming from 3 different tables in mysql database.
I need drag and drop to sort the three sections Messages, Disputes and Services. Also I need to save the sorted order in the database.So the next time the page shows the sections with the saved sort order. Can anyone help me in this?
I have gone through many examples that saves the sorted order, but these examples are saving the static data in to database along with sort order.
I don’t know what drag-and-drop you will be using, but you will want to add an event when an item is dropped. Something like:
This will automatically trigger an update whenever you change the order. You’ll have to check how to get the order and how to store it, but as I have no info on that, I can’t help you there 😉