EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: Steve2106 on November 06, 2019, 11:41:39 AM



Title: setting chckbox in grid unclickable
Post by: Steve2106 on November 06, 2019, 11:41:39 AM
Hi There,

Your help please.

In a grid I am showing checkboxes for 1 of my fields using this code:
function formatCheck(val,row){
    if (val == '1') {
   return '<input type="checkbox" checked>';
    }
    else {
   return '<input type="checkbox">';
   }
}

But users can click on the checkbox in the grid and change checked/unchecked. How do I stop that so if the user clicks on a checkbox nothing happens.

Thanks for your help.

Best Regards,

Steve.




Title: Re: setting chckbox in grid unclickable
Post by: jarry on November 06, 2019, 07:05:56 PM
Set the 'disabled' attribute for the checkbox, or return a checking image instead of the checkbox.
Code:
function formatCheck(val,row){
    if (val == '1') {
   return '<input type="checkbox" checked disabled>';
    }
    else {
   return '<input type="checkbox" disabled>';
   }
}