Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a Sharepoint List called "tasks". The field names are taskname (string), priority (integer). Using JQuery's sortable feature I am at the point that the user can manually sort a list by dragging and dropping items. It looks great but now I want Sharepoint to remember the final priority for each item in the list, say, after pressing a 'save' button. A minimal working example would be great.

share|improve this question
add comment

1 Answer 1

Define a function to be fired on the update method for sortable(). That option will fire any time the user drops the items into their order. You can then push all of the sortable items into an array and fire off an ajax request to SPServices to update each of the list items.

If you want to do it as a button event instead of using the update listener on the sortable object, just bind a function to the button to serialize all of the sortable elements, iterate through them, and call the ajax request to update the order field on each.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.