Hide record checkboxes

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
dlee
Veteran Member
Posts: 168
Joined: 2020-04-14 00:21
Location: South Carolina, USA
Contact:

Hide record checkboxes

Post by dlee » 2025-06-05 03:26

How can I hide the checkbox that are to the left of each record in tableview? They are confusing to my users.

TD
Attachments
appgini checkbox.jpg
appgini checkbox.jpg (18.22 KiB) Viewed 3360 times

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1944
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Hide record checkboxes

Post by jsetzer » 2025-06-05 04:42

How can I hide the checkbox
Create file hooks/TABLENAME-tv.js, if not exists:

(1) Hide select-checkboxes in table view

Code: Select all

// file: hooks/TABLENAME-tv.js
jQuery(() => {
    jQuery('.record_selector,#select_all_records').hide()
});
This will hide the record-selector-checkboxes.

Note, an empty column will remain, which may also confuse users.

Removing checkboxes but keeping the first column is useful for example when having additional buttons in first column. Unless you need it, see alternative code below for hiding the whole column.

(2) Hide column, having select-checkboxes

Code: Select all

// file: hooks/TABLENAME-tv.js
jQuery(() => {
    jQuery('.record_selector,#select_all_records').closest('th,td').hide()
});
Please note that, when hiding the select checkboxes, you cannot multi-select records and therefore you cannot run batch-actions on selected records (like Delete selected records or any custom batch-action).
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 25.10 + all AppGini Helper tools

dlee
Veteran Member
Posts: 168
Joined: 2020-04-14 00:21
Location: South Carolina, USA
Contact:

Re: Hide record checkboxes

Post by dlee » 2025-06-05 06:27

Thank you Jan ! One last question, the checkboxes and column appear just for a faction of a second then disappear whenever the page loads / reloads.
Is there a way to eliminate this? If not, your reply was a great help!

TD

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1944
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Hide record checkboxes

Post by jsetzer » 2025-06-05 06:41

You can try to hide the whole table using CSS, first, then .show() or .fadeIn() in Javascript after you have applied the checkbox-fix.

Hiding table using CSS could be done in hooks/header-extras.php, for example using display: none; on your table element. But I cannot guarantee this is flicker-free. Should be working - not tested.

Something like this:

Code: Select all

<!-- file: hooks/header-extras.php -->
<style>
    table[data-tablename="YOURTABLENAME"] {
        display: none;
    }
</style>

Code: Select all

// file: hooks/TABLENAME-tv.js
jQuery(() => {
    jQuery('.record_selector,#select_all_records').closest('th,td').hide()
    jQuery('table[data-tablename="YOURTABLENAME"]').show();
});


Note: If hiding in hooks/header-extras.php is too late and UI is still flickering, you may try in TABLENAME_header()-hook-function in hooks/TABLENAME.php. Not tested.
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 25.10 + all AppGini Helper tools

dlee
Veteran Member
Posts: 168
Joined: 2020-04-14 00:21
Location: South Carolina, USA
Contact:

Re: Hide record checkboxes

Post by dlee » 2025-06-06 02:43

Jan your last post works perfectly! I always learn from your replies, thank you again!

Post Reply