문제

I want to disable jquery sortable on page load but not sure, someone direct me in right direction please,

In jquery I can do it like this $(".myList").sortable('disable');

Scenario

I have a checkbox based on which I am enabling and disabling jquery sortable for a list, now I can use $(document).ready(function() { and $(checkbox).change(function() { to disable and enable dragging but I can't check it on page load in code behind as checkbox is getting its value from database on pageload.

도움이 되었습니까?

해결책

$(document).ready(function() { 
        if ($('#chcekbox).is(':checked')) {
        $(".myList").sortable('enable');
    } else {
        $(".myList").sortable('disable');
    }  
});
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top