riktar / jkanban

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

Get board id when an item is been moved to it #67

Closed hayjay closed 4 years ago

hayjay commented 4 years ago

Currently, when an item is been moved to a board, three things are been returned namely :

  1. el
  2. target
  3. source
  4. siblings

All these are good to have, but i guess it would be nice if we can have the board id the item is been moved to as well. #dropEl function handles this

riktar commented 4 years ago

Hi @hayjay you can access to the boards data-id simply using Javascript:

dropEl: function(el, target, source, sibling){

  // get target board's id
  console.log(target.parentElement.getAttribute('data-id'));

  // get source board's id
  console.log(source.parentElement.getAttribute('data-id'));

}