jquery-ui sortable - programmatically set item being dragged

为君一笑 提交于 2020-02-08 07:52:05

问题


I have a list of items I want to make sortable. I would like to make that list scrollable, but at the same time I want the handle to pop out to the side of the list.

When clicking on an list item, I can have the pop out show outside the list (at this point, I know which li they have selected), and when they mousedown on a button in the popout, I create the sortable.

Can I create the sortable with the current li as the item being dragged?

The core issue here that I'm trying to work around is that I can make the pop out the handle IF it is a descendant of the item. But if I make the list scrollable, it will clip the handle so I can't pop it out to the right.

IF the pop out is not a descendant of the li, I can position it exactly where I want (to the right of the selected li) but now it cannot be used as the handle for the sortable (since it is not a descendant).

I am wondering if I can programatically create the sortable with the selected li as the item being dragged???

来源:https://stackoverflow.com/questions/25213899/jquery-ui-sortable-programmatically-set-item-being-dragged

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