如何在 JQUERY 中交错排序列表?
我想用一个可排序列表构建一个排序层次结构——没什么花哨的,只需将每个元素向右移动一点,这样它就可以清楚地显示层次结构。
有人见过这样的技术吗?我想了一会儿,认为如果我最初绘制列表,我可以稍微提高每个的左边距
但后来我意识到我不知道如何处理排序上的重新编号...我想我可以在 STOP 上调用一个函数并更改每个元素的左边距...(我刚刚回答了我自己的问题吗?)
无论如何,有人知道这个问题的现有答案吗?我认为有人已经这样做了。
I want to build a hierarchy of sorts with a sortable list -- nothing fancy, just nudge each element of to the right a bit, so it clearly shows the hierarchy.
Has anyone seen a technique for this? I thought about it for a minute and thought that if I initially draw the list, I could just bump the left margin a bit for each
But then I realized that I wouldn't know how to handle renumbering on sort... I guess I could call a function on STOP and change the margin left to each element... (did I just answer my own question?)
Regardless, does anyone know of an existing answer to this? I would think someone would have already done this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
两个选项:
Nestable - http://dbushell .com/2012/06/17/nestable-jquery-plugin/
nestedSortable - http://mjsarfatti.com/sandbox/nestedSortable/
任何一个都应该完全满足您的需要。
Two options:
Nestable - http://dbushell.com/2012/06/17/nestable-jquery-plugin/
nestedSortable - http://mjsarfatti.com/sandbox/nestedSortable/
Either one should do exactly what you need.