0

我有三个可排序的 列表。这些列表是jhonny 可排序插件的可排序宽度。排序后(onDrop),我只需要一个列表的排序数据,而不是所有列表。

<ol class="sortable">
  <li data-id="1">Item I</li>
  <li data-id="2">Item II</li>
  <li data-id="3">Item III</li>
</ol>
<ol class="sortable">
  <li data-id="37">Item A</li>
  <li data-id="12">Item B</li>
  <li data-id="19">Item C</li>
</ol>
<ol class="sortable">
  <li data-id="21">Item One</li>
  <li data-id="22">Item Two</li>
  <li data-id="20">Item Three</li>
</ol>

JavaScript:

  var sort = $("sortable").sortable({
    onDrop: function (item, container, _super) {

    var order = sort.sortable("serialize").get(); 

    // order contains the values of ALL lists
    // shuld only contain the values of the ONE list!

  } 
});
4

1 回答 1

0

尝试

var order = item.parent().sortable("serialize").get(); 
于 2013-05-27T13:24:35.710 回答