Own serialization for jQuery Sortable


/ Published in: jQuery
Save to your folder(s)

If your sortable.serialize() method doesn't work properly, do it by yourself ;-)


Copy this code and paste it in your HTML
  1. $('#sortable').sortable({
  2. placeholder: 'ui-state-highlight',
  3. update : function ()
  4. {
  5. var serial = '';
  6. $('#sortable li.ui-state-default').each(function (key, value) { serial += $(value).attr('id')+'='+parseInt(key+1)+'&'; });
  7. $.ajax({
  8. url: 'ajax.php',
  9. type: 'POST',
  10. data: serial,
  11. });
  12. }
  13. });

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.