Closed marcosrocha85 closed 5 years ago
For those who want do that outside jKanban, you can do jkanban.drake.cancel(true)
at dropEl event. For example:
jkanban = new jKanban({
...
dropEl: function(el, target, source, sibling) {
if (myValidationOfCanDrag) {
jkanban.drake.cancel(true);
}
}
...
);
@riktar, Noticed that dropEl
fires even when the property "dragTo"
is set and the card is dropped on a target board that supposely shouldn't accept dragging from source board. Is it possible to get the "dragTo"
of target at dropEl
element?
Very close issue to #22
Noticed that
dropEl
fires even when the property"dragTo"
is set and the card is dropped on a target board that supposely shouldn't accept dragging from source board.
Suggestion: Don't fire dropEl when the item is now allowed to receive elements from dragTo property.
I'm having the same issue. If I drop an item on a non-allowed target, the dropEl is still fired.
I think I'm going to use a custom drag validation, as @marcosrocha85 suggested.
I'm trying to cancel a drag event in order to prevent moving cards on a automatic board, but when I call
jkanban.drake.cancel(true)
the dragula raises an exception saying "el is null" on touchy function. Do you have any suggestion to implement a "beforeDrag" event in order to validate if a card can be moved? I'm intended to develop that on jKanban.