browse display checkboxes
Posted: Wed May 02, 2018 9:40 am
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?
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">')
}
}
});
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;">')
}
}
});