jQuery Sortable锁定项 [英] jQuery Sortable lock item

查看:97
本文介绍了jQuery Sortable锁定项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一旦将某个项目删除,是否可以将其锁定在可排序"列表中?

Is it possible to lock an item in a Sortable list once it's been dropped?

基本上,我有一个可排序的列表[OBJECT],用户应该将这些对象放入步骤中.这些步骤是静态的/不可移动的.像这样:

Basically, I have a sortable list [OBJECT] that the user is supposed to place the objects into steps. The steps are static/not moveable. Like this:

[步骤1] [对象1]

[Step 1] [OBJECT 1]

[步骤2] [对象2]

[Step 2] [OBJECT 2]

[步骤3] [对象3]

[Step 3] [OBJECT 3]

[步骤4] [对象4]

[Step 4] [OBJECT 4]

所以可以说我将对象1拖动到步骤3:

So lets say I drag object 1 to step 3:

[步骤1] [对象2]

[Step 1] [OBJECT 2]

[步骤2] [对象3]

[Step 2] [OBJECT 3]

[步骤3] [对象1]

[步骤4] [对象4]

[Step 4] [OBJECT 4]

现在,任何拖动的对象都不应更改[对象1]的位置,因为它需要停留在第3步.

Now any object that's dragged SHOULD NOT change the position of [OBJECT 1] because it needs to stay at step 3.

是否可以锁定它?

推荐答案

对我而言,最好的方法是使用drag&降低.我将在此处详细说明我的操作: jQuery Drag&拖放重新排序

The best way for me to achieve this was to use drag & drop. I explain more about what I did here: jQuery Drag & drop- reorder

这篇关于jQuery Sortable锁定项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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