Drag between two sortables
See original GitHub issueI’m having problem moving items between two different zones. It is possible to move item from one to another, but then new drag has to be initiated to sort in the new location.
Btw is it somehow possible to drag item to empty zone?
Live example - http://fluid.cz/projects/react-dnd/
function _moveWidget(e){
var overComponent = e.overComponent.props
var draggedComponent = e.draggedComponent.props
var draggedComponentObj = _.find(_page.zones[draggedComponent.zoneKey].widgets, {'id':draggedComponent.widgetData.id})
var overComponentObj = _.find(_page.zones[overComponent.zoneKey].widgets, {'id':overComponent.widgetData.id})
draggedIndex = _page.zones[draggedComponent.zoneKey].widgets.indexOf(draggedComponentObj);
overIndex = _page.zones[overComponent.zoneKey].widgets.indexOf(overComponentObj);
_page.zones[draggedComponent.zoneKey].widgets.splice(draggedIndex,1)
_page.zones[overComponent.zoneKey].widgets.splice(overIndex, 0, draggedComponentObj)
}
Issue Analytics
- State:
- Created 9 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Sortable drag and drop across two lists (trying to follow the ...
I am trying to find a good implementation of the drag and drop across multiple lists, and I found the one on this...
Read more >Drag from sortable to sortable - jQuery Forum
When rows are dragged between the sections of Table Sortable 1, then the same row (copy) is added to Table Sortable 2, and...
Read more >How to create sortable Drag and Drop with vanilla Javascript
In this video you will learn:How to create sortable Drag and Drop with vanilla JavascriptDemo URL: ...
Read more >Sortable | jQuery UI
Enable a group of DOM elements to be sortable. Click on and drag an element to a new spot within the list, and...
Read more >Drag and drop between 2 divs with JQuery's draggable
I want to be able to drag and drop divs between other divs in the container. ... $("<div class=\"main_block row text-center ui-sortable-handle ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey @gaearon, has theisDragging
problem been addressed? I just upgraded to 1.0.0, rewired everything for the new API, andisDragging
still seems to be wrong after a component is dragged to a new list.I asked too soon but will leave this here for anyone else who stumbles upon this issue. Define a custom
isDragging
method on yourDragSource
as described here. Thanks @gaearon for the excellent library!@ntdb Thanks for using it! Yeah,
isDragging
is the way to go.