Saving the State of Sorted Lists (^) ❘ 357
$('ul#finderOtherCategoryFiles').sortable({
connectWith : 'ul#finderCategoryFiles',
placeholder : 'finderCategoryFilePlaceholder',
opacity : 0.8,
cursor : 'move',
update : function(event, ui)
{
var data = $(this).sortable(
'serialize', {
attribute : 'data-path',
expression : /^(.*)$/,
key : 'categoryFiles[]'
}
);
data += '&categoryId=2';
alert(data);
// Here you could go on to make an AJAX request
// to save the sorted data on the server, which
// might look like this:
//
// $.get('/path/to/server/file.php', data);
}
});
}
);
The preceding document gives you something similar to Figure 13-3.
elliott
(Elliott)
#1