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

Option to disable drag/drop on the board #5

Closed ramanbuttar closed 6 years ago

ramanbuttar commented 6 years ago

Another feature request: Provide an option to keep the boards affixed and not allow drag/drop operations on the board itself.

riktar commented 6 years ago

Now you can use the dragBoards option to activate drag/drop on all boards

brunonetadmin commented 5 years ago

I don´t see any option to not allow drag inside the original board. The dropEl its called even if i drag a item to the same board. Its possible to create this 'feature'?

marcosrocha85 commented 5 years ago

Hi @brunonetadmin , in fact dropEl is called even at the same origin. Are you trying to prevent reordening? Tell us more about what are you trying to achieve.

brunonetadmin commented 5 years ago

I´m trying to execute the action of consulting(ajax) the backend, and showing the status change notifications, but i don´t wanna make anything if the item its dropped in the same column. And i´m not using reordering itens.

And how i trigger a custom action for example, if i try to move a item that are forbidden to go to that column?

marcosrocha85 commented 5 years ago

You can check if source and target are the same. If so, you don't fire ajax request. ;)

dropEl: function(el, source, target, siblings) {
    if (source === target) {
        return;
    }

    $.ajax( //...
}