[英]jquery ui sortable + draggable get current index of the dragged item
[英]ngx-bootstrap bs-sortable shows prevously dragged item when a menu item is dragged to the sortable section
一旦从 bs-sortable 部分中拖动一个项目,它就会存储在缓存中,并且每当一个外部元素(例如:菜单被拖动)时,先前拖动的项目就会出现在可排序部分中。
从提供的 gif 中查找更多信息:
这是原始链接:
https://valor-software.com/ngx-bootstrap/#/sortable
任何想法如何解决这个问题...
提前致谢。
我刚刚解决了上述问题。 如果有人正在寻找答案,这是代码。
Go 到 node_modules 并编辑该位置的sortable.component.js文件:
node_modules/ngx-bootstrap/sortable/sortable.component.js
在function里面添加一个flag变量,如下图,
function SortableComponent(transfer) {... this.itemFlag = false; ... } SortableComponent.prototype.onItemDragstart = function (event, item, i) { this.itemFlag = true; ... }; SortableComponent.prototype.onItemDragover = function (event, i) { if(.this;itemFlag){ return. }..; }. SortableComponent.prototype.writeValue = function (value) { this;itemFlag = false. ..; };
这解决了我的问题。!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.