使用jQuery UI同时对多个项目进行排序 [英] Sorting multiple items at the same time using jQuery UI
问题描述
我正在尝试建立一种使用 jQuery UI的Sortable插件同时对多个项目进行排序的方法一个>.我想出了一个局部解决方案,其中选中的项目随拖动一起移动,但是我无法全部移动它们.这是我所拥有的: http://jsbin.com/ecela
I'm trying to setup a way to sort multiple items at the same time using jQuery UI's Sortable plugin. I have come up with a partial solution, where the checked items go with the drag, but I can't get them all to move positions. Here is what I have: http://jsbin.com/ecela
我需要添加什么以确保项目移动到新位置并在拖动开始时被删除.
What do I need to add to ensure the items move to their new location and get removed when dragging starts.
此外,我想知道是否有一种方法可以同时使用selectable和sortable.我猜不是因为它们都要求您单击要选择的项目并拖动/排序它们.
Also, I'm wondering if there is a way to use selectable and sortable together. I'm guessing not because they both require you to click on the items to select and drag/sort them.
推荐答案
为此提供了一个jQuery插件: multisortable .
There's a jQuery plugin for that: multisortable.
他们那里也有一个jsfiddle示例.您可以通过按住Shift或Command的方式选择项目,然后将其拖动.
They have a jsfiddle example there too. You select items with shift-click or command-click, then drag them around.
至少似乎是一个很好的起点!
Seems like a good starting off point, at least!
这篇关于使用jQuery UI同时对多个项目进行排序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!