Sowmya Sirsi

Sowmya Sirsi

  • NA
  • 173
  • 44.6k

how to disable onclick method

Jul 16 2021 7:36 AM

Hi Team,

js file

======

if (approveview == true && changestatus == false) {
                             
         return '<label class="switch"><input type="checkbox" "' + full.IsActive + '" disabled ><div class="slider round"></div></label>';

} // I tired adding disabled  as in the above line so slider round option has been disabled for all records, still I am able to edit it where it is calling the below onclick function

 

$(document).on('click', '.approve', function (e) {
        var table = $('#tblUsers').DataTable();
        var data = table.row($(this).closest('tr')).data()
        var userid = data.UserID;
        var username = data.UserName;
        
        $('#modaluserid').val(userid);
        $('#modalusername').val(username);
        $('#lblusermodal').text("Are you sure you want to Approve the User");
        $('#userConfirmAppr').modal({
            backdrop: 'static',
            keyboard: false
        });
    });

 

Please assist me how to disable the onclick method


Answers (3)