riktar / jkanban

Vanilla Javascript plugin for manage kanban boards
https://www.riccardotartaglia.it/jkanban/
Apache License 2.0
1.07k stars 299 forks source link

get the ID of source board on dropEl method #34

Closed SachchinAnnam closed 5 years ago

SachchinAnnam commented 5 years ago

Hello Sir, I am using this jkanban in SharePoint and am trying to change the status of dragged item using dropEI method. To achieve this, i thinking to invoke a custom method using element ID and board ID. Am able to get the element ID but i am stuck with board ID.

Please help me with some snippet so that i can proceed with this.

marcosrocha85 commented 5 years ago

Hello @SachinAnnam, you are using dropEl event aren't you? You can get parent board from item by doing some DOM calls:

dropEl: function(el, source, target, siblings) {
  console.log(el.parentElement.parentElement.id); // will output your boardId
}