开发者

jQuery UI Sortable and Draggable issues

I have a nested Sortable which is not working quite well on it's own, but I've added a Draggable too, which is causing even more problems.

  • Sorting items between nested Sortables is almost impossible, try it ;)
  • Dragging a Draggable into the inner Sortable also adds a new item to the outer Sortable as well

Example: JSFiddle

I guess this is just impossible to achieve with the开发者_C百科 current version of jQuery UI.


Edit: see comment below


<ul>
   <li>Item 1</li>
   <li>Item 2</li>
   <li>Item 3</li>
   <li>
       <ul> <li>Item 4</li> </ul>
   </li>
</ul>

$('ul').bind('mouseenter',function (){
   //$(this).parents('ul').sortable('destroy');//this line is optional... :)
   $(this).sortable({'items':'li'});
});
$('ul').bind('mouseleave',function (){
   $(this).sortable('destroy');
});

this may not work as I have not tested it but you do get the idea I hope :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜