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