Sortable.serialize |
The Sortable object also provides a function to serialize the Sortable in a format suitable for HTTP GET or POST requests. This can be used to submit the order of the Sortable via an Ajax call:
Availability
script.aculo.us V1.0 and later.
Syntax
Sortable.serialize('id_of_container',[options]);
Options
Example
var userTopTen = Sortable.serialize('top10'); // userTopTen now contains key[]=value pairs seperated by &
new Ajax.Request('/users/mytop10/saveorder', {parameters: userTopTen});
Notes
For this to work, the elements contained in your Sortable must have id attributes in the following form:
<li id="image_1">Something</li>
You can tweak this by modifying the format parameter in the Sortable.create call
|