2013-12-20 44 views
0

Ey帅哥,请看看这个小提琴:http://jsfiddle.net/HG8k6/Jquery UI中的连接嵌套列表可排序

$(document).ready(function() { 
    $("ul.containers").sortable({ 
     axis: 'y', 
     placeholder: "ui-state-highlight", 
     forcePlaceholderSize: true 
    }); 

    $("ul.containers").disableSelection(); 

    $("ul.rows").sortable({ 
     axis: 'y', 
     placeholder: "ui-state-highlight", 
     forcePlaceholderSize: true 
    }); 

    $("ul.rows").disableSelection(); 
}); 

它以某种方式工作确定,我有集装箱和行,我可以将它们完美的,但是我真正想实现的是容器之间移动行,例如从container2的移动ROW5到Container1。预先感谢哥伦比亚和南美洲的问候!

回答

3

使用connectWith:'.rows'已更新fiddle

+0

太棒了!有用!所以我在这里先进了......但请看看小提琴,现在我的问题是当我添加一个动态容器的行,行不能被拖动......怪异......如果我只是添加一排,它像一个魅力。谢谢! – Roger

+0

只是对新添加的行进行初始化排序。我已经更新小提琴请看http://jsfiddle.net/HG8k6/4/ –

+0

优秀!现在它工作得很好,但为什么容器行为与行不同,都是以动态方式添加的。谢谢你的帮助! – Roger