Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can i block drag/drop any board item? #139

Closed
Rampesna opened this issue Aug 5, 2021 · 6 comments
Closed

How can i block drag/drop any board item? #139

Rampesna opened this issue Aug 5, 2021 · 6 comments

Comments

@Rampesna
Copy link

Rampesna commented Aug 5, 2021

I want to block some items dragging, how can i do?

@xscode-auto-reply
Copy link

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

@Rampesna
Copy link
Author

Rampesna commented Aug 5, 2021

{
  id: id,
  title: title,
  draggable: false // custom data i was add
}

I was add custom data(draggable) for item. And i am controlling this data on dragEl function;

dragEl: function (el, source) {
    if (el.dataset.draggable === 'false') {
        // How can i stop drag transaction at here?
    }
},

I want to stop drag transaction if draggable data is false. I tried return false; but it wasn't work.

This is enought for block any item draggable for me but i cant stop drag transaction.

@marcosrocha85
Copy link
Contributor

Use this. #112 (comment)

@Rampesna
Copy link
Author

Rampesna commented Aug 6, 2021

I tried but it gives me an error:

Uncaught TypeError: Cannot read property 'getBoundingClientRect' of null

// ...
var r = function (e) {
    var t = e.getBoundingClientRect();
    return {
        left: t.left + K("scrollLeft", "pageXOffset"),
        top: t.top + K("scrollTop", "pageYOffset")
    }
}(m);
// ...

@Rampesna
Copy link
Author

Rampesna commented Aug 6, 2021

I was fixed problem like that;

var r = function (e) {
    var t = e.getBoundingClientRect();
    if (t) {
        return {
            left: t.left + K("scrollLeft", "pageXOffset"),
            top: t.top + K("scrollTop", "pageYOffset")
        }
    }
}(m);

Thanks!

@marcosrocha85
Copy link
Contributor

Very good. Please close the issue.

@Rampesna Rampesna closed this as completed Aug 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants