如何使jQuery UI排序嵌套下拉菜单工作? [英] How to make jQuery UI sortable with nested dropdown menu work?

查看:222
本文介绍了如何使jQuery UI排序嵌套下拉菜单工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经读过类似于我在这里张贴的问题,但找不到任何解决方案。



我已经在下拉列表中创建了一个带子菜单条目的菜单。所有菜单项可以分类到所有菜单级别。根菜单条目到子列表,另一种方式。



几乎一切都正常,但排序到第一个下拉菜单会导致错误。在第一个下拉菜单之前对菜单条目进行排序是不可能的,也不能在第一个下拉菜单中进行排序。通过尝试在第一个下拉列表中排序,邻居(最后)下拉列表中的占位符代码生成和停止排序条目也在最后一个下拉列表中,而不是在第一个内部。排序到其他下拉列表没有这种行为。也许有人有一个想法吗?



这是js-fiddle:
http://jsfiddle.net/dehil/Vy4pu/1/

  $('ul')。sortable({// 
connectWith:$('ul'),
items:'li',
placeholder:'pf_sortable-placeholder',
容忍度:'pointer',
cursor:'pointer',
cursorAt:{
顶部:-20
},
zIndex:20000,
占位符:'pf_sortable-placeholder',
})


解决方案

使用jQuery UI,嵌套列表总是有点尴尬。最近我发现可能是 http://johnny.github.com/jquery-sortable/ 用于对引导导航进行排序。



请参阅 http://johnny.github.com/jquery-sortable/#bootstrap


I've read everything similar to my problem posted here but not found any solution.

I have created a menu with sub menu entries inside dropdowns. All menu entries are sortable to all menu levels. root menu entries to child lists and the other way.

Nearly everything works fine but sorting to the first dropdown results a bug. It is neighter not possible to sort a menu entry before the first dropdown nor to sort inside the first dropdown. By trying to sort inside the first dropdown the placeholder code spawn inside the neighbor (last) dropdown and on stop sorting the entry also is inside the last dropdown and not inside the first like it should. Sorting to the other dropdowns does not have this behavior. Maybe anybody has an idea about it?

Here is the js-fiddle: http://jsfiddle.net/dehil/Vy4pu/1/

$('ul').sortable({ //    
    connectWith: $('ul'),
    items: 'li',
    placeholder: 'pf_sortable-placeholder',
    tolerance: 'pointer',
    cursor: 'pointer',
    cursorAt: {
        top: -20
    },
    zIndex: 20000,
    placeholder: 'pf_sortable-placeholder',
})

解决方案

Nested lists are always a bit awkward with jQuery UI. Recently I found http://johnny.github.com/jquery-sortable/ which may be used to sort bootstrap navs.

See http://johnny.github.com/jquery-sortable/#bootstrap.

这篇关于如何使jQuery UI排序嵌套下拉菜单工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆