Reputation: 1337
I am using this plugin:
https://github.com/RubaXa/Sortable
I want to make the list undraggable when the user clicks the button. From the github page, it seems that I can use disable:true
to do so but how do I make it work on button click?
I have tried:
Sortable.create(simpleList, {
$('#button').click(function () {
disable: true,
})
});
But it makes the undraggable to begin with.
Non-working Demo:
Working Demo:
http://jsfiddle.net/880auLx8/1/
Upvotes: 1
Views: 440
Reputation: 8205
If you go with the instructions in the readme, you should get something along the lines of:
var sortable = Sortable.create(simpleList, {});
$("#button").click(function () {
sortable.option("disabled", true);
});
Upvotes: 1