Jquery nestedSortable block the drag of an element to the top level

天涯浪子 提交于 2019-12-06 05:11:54

I modified the code a little with $.extend() and I think I came pretty close --> http://jsfiddle.net/Galled/dAwEe/85/

From the plugin website:

Requires:

jQuery 1.4+

jQuery UI Sortable 1.8+

Probably will not solve your problem, but not all browsers support empty tag notation for script tags. You need to close them with a closing script tag.

<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js' type='text/javascript'/>

Needs to be

<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js' type='text/javascript'></script>
cheny

Problem two:

isAllowed can be used to enable or block a position. To block the root position, you can use codes like this:

        isAllowed: function (item, parent) {
            if (parent == null) { //Parent == null means the root.
                return false;
            }
        }

see more information here: NestedSortable: isAllowed() does not work when connectWith() is used

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!