Hide the "Add New" button

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
Post Reply
rpierce
Veteran Member
Posts: 258
Joined: 2018-11-26 13:55
Location: Washington State

Hide the "Add New" button

Post by rpierce » 2022-03-31 22:03

Is there a way to hide the Add New button on a certain table?

peebee
AppGini Super Hero
AppGini Super Hero
Posts: 352
Joined: 2013-03-21 04:37

Re: Hide the "Add New" button

Post by peebee » 2022-03-31 23:46

Have you tried unchecking the "Insert" privilege button for the particular table on the Group permissions in the Admin area?

Result = no "Add New" button for that Group on that table.

rpierce
Veteran Member
Posts: 258
Joined: 2018-11-26 13:55
Location: Washington State

Re: Hide the "Add New" button

Post by rpierce » 2022-04-01 15:04

I want users to be able to add new records to the table, but only while in DV-TV of the parent record. If they are in table view of the target table I want the "Add New" button hidden or disabled.

xbox2007
Veteran Member
Posts: 136
Joined: 2016-12-16 16:49

Re: Hide the "Add New" button

Post by xbox2007 » 2022-04-20 20:31

to hide Add New in detail view
use this code on tablename-dv.js

Code: Select all

$j('#addNew').hide();
in table view
use this code in tablename-tv.js

Code: Select all

$j('#addNew').hide();

rpierce
Veteran Member
Posts: 258
Joined: 2018-11-26 13:55
Location: Washington State

Re: Hide the "Add New" button

Post by rpierce » 2022-04-28 03:21

This code is working for DV but not TV.

User avatar
zibrahim
Veteran Member
Posts: 137
Joined: 2020-01-28 18:30
Location: Malaysia

Re: Hide the "Add New" button

Post by zibrahim » 2022-05-04 02:26

I use setInterval function for TV. The AddNew button will eventually appear momentarily and then disappear.

Code: Select all

// hide the AddNew button after set interval value
$j(function () {
    setInterval(function () {
        $j('#addNew').hide();
    }, 100);
});
If anyone have better solution, please share.

Thanks.
Zala.
Appgini 24.10.1579, MacOS 14.3.1 Windows 11 on Parallels.

Post Reply