可排序的jQuery UI:如何从已连接列表中排除项目? [英] jQuery UI sortable: How to exclude items from connected lists?

查看:56
本文介绍了可排序的jQuery UI:如何从已连接列表中排除项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个连接的列表(左/右列),因此我可以将项目从一列(左)拖放到另一列(右).

I have two lists (left/right coloumn) which are connected, so I can drag&drop items from one column (left) to the other (right).

如何在不能将其拖放到源列表中的功能的同时从列表1(左)中排除不应拖动到列表2(右)的特定项目?

How can I exclude specific items from list1 (left) that should NOT be draggable to list2 (right) while keeping the functionality to drag&drop them inside their source-list?

提琴: http://goo.gl/7ZKfrl

推荐答案

我使用了以下内容,并且对我有用.有相同的要求.

I used the following and it worked for me. Had same requirement.

$("ul#YourLeftListID li").each(function () {
            if ($(this).text() == 'None') {
                $(this).draggable({ disabled: true })
            }
        });

希望这会有所帮助.

这篇关于可排序的jQuery UI:如何从已连接列表中排除项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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