dragging from a sortable list to a drag and drop plugin

亡梦爱人 提交于 2019-12-12 09:20:10

问题


I am trying to allow dragging from a sortable list to a dynatree.

My initial though was to specify something like this:

    $('#ews_pgs_clpbrd_items').sortable({
        connectToDynatree: true
    }).disableSelection();

dynatree does not register the drag and drop events for the sortable items. so I tried

    $("#ews_pgs_clpbrd_items").sortable().disableSelection();
    $("#ews_pgs_clpbrd_items li").draggable({
        connectToDynatree: true,
        connectToSortable: "#ews_pgs_clpbrd_items"
    });

This allows the items in the sortable list to be dragged to the dynatree but it no longer allows sorting. When I try to sort I get the following error.

Cannot read property 'options' of undefined

This appears to just be a limitation on sortable since http://jsfiddle.net/7TTSG/3/ it happens even without dynatree.

Is there a way to pass the drag and drop option "connectToDynatree: true" in the sortable or a way to make drag and drop not break sortable?

来源:https://stackoverflow.com/questions/17928139/dragging-from-a-sortable-list-to-a-drag-and-drop-plugin

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