I have around 8 div items arranged in UL LI list. Each has unique ID, and specific content.These items are sortable, I am using jquery UI for this. Once user drag and drop component position of list item changes. But after refreshing the page I am getting same HTML page. I want to retain new positions of items at server. What is the effective way to do this? I can create clone of HTML and retain it during the session but i want changes to be saved at server. The change of position of the element is specific to user.. This is something like element positions are changed by the user and he want to save the settings.. thank for the help in advance
Asked
Active
Viewed 316 times
1
-
What callback do you get after sorting? There are many technologies for acomplishing this. I have forgoten how its called when there is used left and right id tables for this. Maybe someone will help to remember. – Ernestas Stankevičius Sep 26 '11 at 11:40
2 Answers
2
Don't bother inspecting the resulting HTML. Rather, just communicate the new ordering of the items back to the server via AJAX. This could be as simple as a sequence of numbers. Store those and use them next time to create the list in the desired order.

Kerrek SB
- 464,522
- 92
- 875
- 1,084
-
can u please eleborate your solution. How to get order of list elements? – suma dharawad Sep 26 '11 at 11:47
-
Your JavaScript code should be able to get a hand on the current order of the elements. – Kerrek SB Sep 26 '11 at 11:55
-
0
you could store the position in a cookie, and rearange after refresh based on that cookie

Vlad Balmos
- 3,372
- 19
- 34