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

前端 未结 8 1482
我寻月下人不归
我寻月下人不归 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条回答
  •  Happy的楠姐
    2020-12-23 20:09

    The best way is know to use var order = $('ul').sortable('serialize'); feature is shown in the following link :

    http://blog.arnaud-k.fr/2010/09/29/tutorial-jquery-trier-une-liste-en-dragndrop-avec-jqueryui-sortable/

    All you need to get the ordered list data in your php file is the code :

    foreach( $_POST['id'] as $order => $order_nb )
    {
        ...
    }
    

提交回复
热议问题