Closed bairog closed 3 years ago
Thanks for opening a new issue. The team has been notified and will review it as soon as possible. For urgent issues and priority support, visit https://xscode.com/riktar/jkanban
@marcosrocha85 maybe you can help me and answer some of that questions?
@bairog you can find a lot of others past "problems" in Closed issues. I suggest you to take a look and try to figure out if some solution fits your needs. For instance, look at this https://github.com/riktar/jkanban/issues/22.
I suggest you to take a look and try to figure out if some solution fits your needs. For instance, look at this #22.
Thank you I've used your code sample
var allowedBoards = [];
jkanban.options.boards.map(function (board) {
if (board.id === $(source.parentElement).data("id")) {
board.dragTo.map(function (_board) {
if (allowedBoards.indexOf(_board) === -1) {
allowedBoards.push(_board);
}
});
return allowedBoards[0];
}
return allowedBoards[0];
});
if (allowedBoards.length > 0 && allowedBoards.indexOf($(target.parentElement).data("id")) === -1) {
kanban.drake.cancel(true);
return;
}
but slightly modified and simplified it:
var allowedBoards = jkanban.options.boards.filter(b => b.id === source.parentElement.dataset.id)[0].dragTo;
if (allowedBoards.indexOf(target.parentElement.dataset.id) === -1) {
jkanban.drake.cancel(true);
return;
}
I suggest you to take a look and try to figure out if some solution fits your needs. For instance, look at this #22.
Thank you I've used your code sample
var allowedBoards = []; jkanban.options.boards.map(function (board) { if (board.id === $(source.parentElement).data("id")) { board.dragTo.map(function (_board) { if (allowedBoards.indexOf(_board) === -1) { allowedBoards.push(_board); } }); return allowedBoards[0]; } return allowedBoards[0]; }); if (allowedBoards.length > 0 && allowedBoards.indexOf($(target.parentElement).data("id")) === -1) { kanban.drake.cancel(true); return; }
but slightly modified and simplified it:
var allowedBoards = jkanban.options.boards.filter(b => b.id === source.parentElement.dataset.id)[0].dragTo; if (allowedBoards.indexOf(target.parentElement.dataset.id) === -1) { jkanban.drake.cancel(true); return; }
Nicely done!!! At that time I wasn't able to use filter (I can't remember why). Please close the issue if your problem was solved. I suggest you to create different issues for different questions.
Please close the issue if your problem was solved. I suggest you to create different issues for different questions.
Closed this one as my DropTo issue is solved now. Created separate issues: #148 for ItemHover and #149 for AddForm
Hello and thank you for your awesome library. As I can see dropEl callback fires even if item cannot be dragged to the target board (DragTo option of the source board doesn't have target board Id in it). I need to identify such situations (and don't perform all logic that is called in case of "allowed" drag). I've started with the following code but I have no idea howto read
DropTo
option value here (I pass an extrajKanban
value in my function because I need it to find a board):