EasyUI Forum
April 29, 2024, 10:46:27 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: How to display a true / false value in a datagrid as a checkbox  (Read 9028 times)
morib
Newbie
*
Posts: 14


View Profile
« on: May 06, 2014, 01:05:30 PM »

I am using the datagrid without any editor feature.  One of the columns contains a boolean value (true or false).  The users want the grid to show a static checked checkbox when the value is true and a static unchecked checkbox otherwise. Is this feasible?

Thanks!
Logged
morib
Newbie
*
Posts: 14


View Profile
« Reply #1 on: May 06, 2014, 01:21:34 PM »

I found a way to do this.  I use a formater function on the boolean column as shown below.

                 formatter: function (value) {
                     if (value == 'True') {
                         return '<input type="checkbox" checked>';
                     }
                     else {
                         return '<input type="checkbox" >';
                     }
Logged
arma
Full Member
***
Posts: 110


View Profile
« Reply #2 on: May 06, 2014, 07:25:49 PM »

Instead of using checkbox for display purpose you could use this char '√' Smiley
Logged
morib
Newbie
*
Posts: 14


View Profile
« Reply #3 on: May 09, 2014, 07:59:45 AM »

Good idea, thanks !
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!