【问题标题】:How do I store the state of a dropped item using Vanilla Js Drag and Drop?如何使用 Vanilla Js 拖放存储已放置项目的状态?
【发布时间】:2019-11-27 22:13:34
【问题描述】:

我正在尝试存储可拖动项目的状态,以便将它们拖放到网络应用程序的任何位置。我正在使用jKanban Library

我希望将item-1Board A拖到Board B,重启应用并在Board B中找到item-1

【问题讨论】:

  • ondrop 存储一个值。

标签: javascript drag-and-drop draggable dragula


【解决方案1】:

为我工作试试。

 dropEl: function(el, target, source, sibling){
         console.log (el.getAttribute('data-eid')); // ID OF ELEMENT - TASK
         console.log(target.parentElement.getAttribute('data-id')); // ID OF BOARD 
  });

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-03-23
    • 2020-09-20
    • 1970-01-01
    相关资源
    最近更新 更多