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

How can I know which board was the elemnt dropped to? #23

Closed kojaktaha closed 5 years ago

kojaktaha commented 5 years ago

How can I Know which board was the element dropped to?

marcosrocha85 commented 5 years ago

Hello @kojaktaha, there is an event called dropEl which you can track where element was dropped.

jkanban = new jKanban({
    element: '#your_element',
    dropEl: function(el, target, source, sibling) {
        console.log(target);
    }
}
kojaktaha commented 5 years ago

Hello @kojaktaha, there is an event called dropEl which you can track where element was dropped.

jkanban = new jKanban({
    element: '#your_element',
    dropEl: function(el, target, source, sibling) {
        console.log(target);
    }
}

Thanks

bazzacad commented 5 years ago

I have this question too. The "target" shows me all the elements on the board I dropped on, but how do I get the ID of the board I dropped on? image

I want these IDs: image

kojaktaha commented 5 years ago

use : target.parentNode.dataset.id

marcosrocha85 commented 5 years ago

Or if you're using jQuery: $(target.parentElement).data("id")

bazzacad commented 5 years ago

Thanks very much both of you.