EasyUI
Home
Demo
Tutorial
Documentation
Download
Extension
Contact
Forum
EasyUI Forum
April 29, 2024, 05:17:22 PM
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
:
Home
Help
Search
Login
Register
EasyUI Forum
>
General Category
>
EasyUI for jQuery
>
How to display a true / false value in a datagrid as a checkbox
Pages: [
1
]
« previous
next »
Print
Author
Topic: How to display a true / false value in a datagrid as a checkbox (Read 9027 times)
morib
Newbie
Posts: 14
How to display a true / false value in a datagrid as a checkbox
«
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
Re: How to display a true / false value in a datagrid as a checkbox
«
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
Re: How to display a true / false value in a datagrid as a checkbox
«
Reply #2 on:
May 06, 2014, 07:25:49 PM »
Instead of using checkbox for display purpose you could use this char '√'
Logged
morib
Newbie
Posts: 14
Re: How to display a true / false value in a datagrid as a checkbox
«
Reply #3 on:
May 09, 2014, 07:59:45 AM »
Good idea, thanks !
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> News
=> General Discussion
=> EasyUI for jQuery
=> EasyUI for Angular
=> EasyUI for Vue
=> EasyUI for React
=> Bug Report
Loading...