EasyUI Forum
May 15, 2024, 03:54:27 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: setting chckbox in grid unclickable  (Read 2362 times)
Steve2106
Newbie
*
Posts: 20


View Profile Email
« 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.


Logged
jarry
Administrator
Hero Member
*****
Posts: 2264


View Profile Email
« Reply #1 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>';
   }
}
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!