【问题标题】:nestedSortable connected sortablenestedSortable 连接可排序
【发布时间】:2012-09-19 18:08:42
【问题描述】:

是否可以连接两个嵌套的可排序列表?

我尝试过的一些事情。

第一个列表是可排序列表,第二个是嵌套排序列表,只要未将嵌套排序列表设置为与可排序列表连接,我就可以将项目拖动到嵌套列表中。如果我将nestedSortable 列表设置为与可排序列表连接,则nestedSortable 列表将停止工作。

其次。如果两个列表都设置为 nestedSortable,则一旦您尝试拖动项目,浏览器就会崩溃。

我希望能够将项目从nestedSortable 列表拖到可排序列表或使用两个nestedSortable 列表。

这可能吗? 谢谢

示例代码如下:

(function() {
        $( ".sortablelistone" ).sortable({
            connectWith: ".sortable"
        }).disableSelection();
    });

$(function() {
        $( ".sortablelisttwo" ).nestedSortable({
            connectWith: ".sortable"
        }).disableSelection();
    });

<ol class="sortablelistone sortable">
<li>Link One</li>
<li>Link Two</li>
</ol>

<ol class="sortablelisttwo sortable">
<li>Link One</li>
<li>Link Two</li>
</ol>

【问题讨论】:

    标签: jquery list nested jquery-ui-sortable nested-sortable


    【解决方案1】:

    是的,可以使用 nestedSortable 插件连接 2 个列表。试试这样的:

    (function() {
          $( ".sortablelistone, .sortablelisttwo" ).nestedSortable({
                connectWith: ".sortable"
                /* other settings */
          }).disableSelection();
    });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-07-08
      • 1970-01-01
      • 2018-03-25
      • 1970-01-01
      • 1970-01-01
      • 2018-01-10
      • 1970-01-01
      相关资源
      最近更新 更多