admin管理员组文章数量:1356413
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");
}
});
本文标签: javascriptjQuery sortable enableStack Overflow
版权声明:本文标题:javascript - jQuery sortable enable - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744047106a2581731.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论