jquery nested sortable list

Posted by Y.G.J on Stack Overflow See other posts from Stack Overflow or by Y.G.J
Published on 2010-03-21T12:19:21Z Indexed on 2010/03/21 12:21 UTC
Read the original article Hit count: 1014

Filed under:
|
|

i have this code

$(document).ready(function() {
    $("#test-list").sortable({
        items: "> li",
        handle : '.handle',
        axis: 'y',
        opacity: 0.6,
        update : function () {
            var order = $('#test-list').sortable('serialize');
            $("#info").load("process-sortable.asp?"+order+"&id=catid&order=orderid&table=tblCats");
        }
    });
    $("#test-sub").sortable({
        containment: "ul",
        items: "li",
        handle : '.handle',
        axis: 'y',
        opacity: 0.6,
        update : function () {
            var order = $('#test-list').sortable('serialize');
            $("#info").load("process-sortable.asp?"+order+"&id=catid&order=orderid&table=tblCats");
        }
    });
});

for this kind of UL

<ul id="test-list">
  <li></li>
  <li>
    <ul id="test-sub">
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
   </ul>
  </li>
  <li></li>
  <li></li>
  <li></li>
  <li></li>
</ul>

but it can be changed dynamiclly... when i drag and drop the main li it is working when i do it with the childs it will drag the main one

what is wrong?

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about nested-lists