jQuery: What to do with the list that sortable('serialize') returns?

前端 未结 8 1472
我寻月下人不归
我寻月下人不归 2020-12-23 20:01

With jQuery I\'m retrieving positions of a sortable list using \'serialize\', like this:

var order = $(\'ul\').sortable(\'serialize\');

The vari

8条回答
  •  既然无缘
    2020-12-23 20:32

    Found it! I needed to add the option key:'string' which changes the variable name to 'string' instead of 'id'.

    var order = $('#projects ul').sortable('serialize',{key:'string'});
    
    $.post('ajax.php',order+'&action=updateOrder');
    

提交回复
热议问题