Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
browse display checkboxes
browse display checkboxes
A browse form shows 0 or 1 for TINYINT(1), BOOLEAN db fields. Checkboxes like ☑ / ☐ would look nicer. Is there an easy way to do this?
Re: browse display checkboxes
Timo,
Try this - (place it in the Javascript of the Browse Form you want to change).
Steven
Try this - (place it in the Javascript of the Browse Form you want to change).
Code: Select all
$("[data-nu-column='1']").each(function(index) {
if($( this ).html() == '1'){
$( this ).html('<input type="checkbox" checked>')
}else{
if($( this ).html() != ''){
$( this ).html('<input type="checkbox">')
}
}
});
-
- Posts: 785
- Joined: Sun Oct 14, 2018 11:25 am
Re: browse display checkboxes
I made just a small improvement to this code so that checkboxes are not clickable but appear still enabled (not grayed out)
Code: Select all
$("[data-nu-column='1']").each(function(index) {
if ($(this).html() == '1') {
$(this).html('<input type="checkbox" checked onclick="this.checked=!this.checked;" >')
} else {
if ($(this).html() != '') {
$(this).html('<input type="checkbox" onclick="this.checked=!this.checked;">')
}
}
});