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!
Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.
Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.
Show Checkbox in ListView
-
- nuBuilder Team
- Posts: 4562
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 76 times
- Been thanked: 528 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: 4562
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 76 times
- Been thanked: 528 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=";">')
});