Hi,
I couldn't find a solution to show Checkboxes in the Listview.
Is this possible somehow in the current Version of nuBuilder?
BR, Oli
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.
Show Checkbox in ListView
-
- nuBuilder Team
- Posts: 4297
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 444 times
- Contact:
Re: Show Checkbox in ListView
Hi,
What is the purpose of the checkboxes? As replacement for 0,1 values or something else?
What is the purpose of the checkboxes? As replacement for 0,1 values or something else?
-
- nuBuilder Team
- Posts: 4297
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 444 times
- Contact:
Re: Show Checkbox in ListView
To add checkboxes in the first column (index 0):
Code: Select all
$("[data-nu-column='0']").each(function(index) {
let pk = $(this).attr('data-nu-primary-key');
let checked = $(this).html() == '1' ? 'checked="checked"' : '';
$(this).html('<input type="checkbox" ' + checked + ' id="' + pk + '" name="mycheckbox[]" onclick=";">')
});