jQuery — 嵌套可排序插件 — 禁用父级之间的可排序性
我有一个问题,我认为很简单,但我一直无法弄清楚。
这是关于这个插件的: http://mjsarfatti.com/sandbox/nestedSortable/
本质上,我想禁用对父母之外的孩子进行分类的能力。
所以,我得到了这个:
CATEGORY 1
ITEM 1.1
ITEM 1.2
ITEM 1.3
CATEGORY 2
ITEM 2.1
ITEM 2.2
ITEM 2.3
所以,我想为用户提供对其类别内的子项进行排序的能力,以及对类别本身进行排序的能力。但我想禁用将孩子转移给另一个父母的能力。 (例如,项目 1.1 不能移至类别 2)。而且我还想禁用将任何父母嵌套在任何孩子中的能力。
我尝试设置它,以便为每个新 OL 调用“nestedSortable”函数,但这个简单的操作完全禁用了对所有内容的排序。
感谢您的任何帮助。
I've got a question that I think is simple but I've not been able to figure it out.
This is in regard to this plugin: http://mjsarfatti.com/sandbox/nestedSortable/
Essentially, I want to disable the ability to sort children outside of their parents.
So, I've got this:
CATEGORY 1
ITEM 1.1
ITEM 1.2
ITEM 1.3
CATEGORY 2
ITEM 2.1
ITEM 2.2
ITEM 2.3
So, I'd like to provide the ability for users to sort the children within their category, and the ability to sort the categories themselves. But I want to disable the ability to move a child to another parent. (e.g. ITEM 1.1 cannot be moved to CATEGORY 2). And also I would like to disable the abilty to nest any parents in any children.
I tried setting it so that the 'nestedSortable' function is called for every new OL but that simple disables sorting for everything entirely.
Thanks for any help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
刚刚在这里回答了本质上相同的问题:
jQuery UI:只允许在其自己的父级别内排序,不能高于或低于
Just answered what is essentially an identical question here:
jQuery UI: Only allow sortable within its own parent level, and not above or below