I'm disabling dragging on jquery sortable list but not sure how to enable it back, can someone point me in direction please,
$(".anotherClass").sortable('disable'); //it disables it
I can't seem to find anything in documentation.
This question says enable input here but its not working
$("#wantedItems").sortable({
receive: function (event, ui) {
//enable the input here which input ???????????????????????????????
}
});
I'm disabling dragging on jquery sortable list but not sure how to enable it back, can someone point me in direction please,
$(".anotherClass").sortable('disable'); //it disables it
I can't seem to find anything in documentation.
This question says enable input here but its not working
$("#wantedItems").sortable({
receive: function (event, ui) {
//enable the input here which input ???????????????????????????????
}
});
Share
Improve this question
edited Dec 29, 2017 at 7:26
KARTHIKEYAN.A
20.2k10 gold badges137 silver badges150 bronze badges
asked Mar 5, 2013 at 14:28
MathematicsMathematics
7,62826 gold badges82 silver badges161 bronze badges
1
-
Just to clarify, you want to enable
$(".anotherClass").sortable()
? – Dom Commented Mar 5, 2013 at 14:30
4 Answers
Reset to default 4You just call it with 'enable'
$( ".selector" ).sortable( "enable" );
Documentation for method: http://api.jqueryui./sortable/#method-enable
simply write.....
$(".anotherClass").sortable()
enable()
Enables the sortable.
- This method does not accept any arguments.
Code examples:
Invoke the enable method:
$( ".selector" ).sortable( "enable" );
Link: http://api.jqueryui./sortable/#method-enable
To enable sortable()
again you can use
$(".anotherClass").sortable("enable");
To toggle enable/disable on the click of a button with id toggleButton
$('#toggleButton').click(function() {
//check if sortable() is enabled and change and change state accordingly
// Getter
var disabled = $(".anotherClass").sortable( "option", "disabled" );
if (disabled) {
$(".anotherClass").sortable( "enable" );
}
else {
$(".anotherClass").sortable("disable");
}
});