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

Disabling dragging/sorting. #15

Open
hledo opened this issue Oct 14, 2015 · 5 comments
Open

Disabling dragging/sorting. #15

hledo opened this issue Oct 14, 2015 · 5 comments

Comments

@hledo
Copy link

hledo commented Oct 14, 2015

Hi!

How do it disable draggin/sorting? i couldn't find any info on that on the documentation.

@CristianMR
Copy link

Hi @meltedscripts

Maybe is too late but, for the entire list do this:

<div ng-nestable ng-model="items" ng-class="{'dd-nodrag': ctrl.noDragValue}"></div>

Cheers

@hledo
Copy link
Author

hledo commented Feb 23, 2016

Thanks!

@jpmohan1111
Copy link

jpmohan1111 commented Apr 11, 2017

@CristianMR Can u please give an example on how you disabled the drag functionality with code

@CristianMR
Copy link

@jpmohan1111 I'm sorry, but I have not a lot of spare time at the moment. But, ng-class would add dd-nodrag to the element classes if the value on ctrl.noDragValue is true. With that in mind, I searched inside the jQuery Nestable library and found a solution. Just follow noDragClass, which value is setted with dd-nodrag.

Line here and here

The handling of the drag is canceled because of the 'dd-nodrag' class on the element.

I think that's enough for you to understand why this works, it's not documented, that's all.

@YaroslavG
Copy link

hello guys,
when I add ng-class="{'dd-nodrag': ctrl.noDragValue}" it still not working for me

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

4 participants