Removing AddNew and Delete buttons... Possible?

The recommended method of customizing your AppGini-generated application is through hooks. But sometimes you might need to add functionality not accessible through hooks. You can discuss this here.
Post Reply
KSan
AppGini Super Hero
AppGini Super Hero
Posts: 252
Joined: 2013-01-08 20:17

Removing AddNew and Delete buttons... Possible?

Post by KSan » 2013-05-06 03:56

Hi,

I have an app where there is a table containing my settings data. I create the records that need to be there ahead of time and I don't want my users to add new ones or delete the existing ones. I was able to remove Save As Copy using the AppGini option in Table setup screen but I can't see any options to limit deletions or new records. I know I can go into php and take out the buttons all together but short of doing that I wanted to check if there is no other option I am missing.

Thanks for your help. Regards,
Kerem

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

Re: Removing AddNew and Delete buttons... Possible?

Post by peebee » 2013-05-06 04:25

You can simply vary your Users access/rights by changing their Group permissions in the Admin area (View Groups -> select the group) of your generated database.

Just uncheck "Insert" and set "Edit" & "Delete" to "No" for the table(s) concerned and the buttons will disappear. No coding required.

If for any reason you want to remove the buttons by removing the html, just go to templates folder and open yourtable_templateDV.html in an editor.

You'll see;

Code: Select all

<td rowspan="6" valign="top"><div class="buttons dv">
						<%%DVPRINT_BUTTON%%>
						<%%UPDATE_BUTTON%%>
						<%%DELETE_BUTTON%%>
						<%%DESELECT_BUTTON%%>
						<br />
						<%%INSERT_BUTTON%%>
						</div></td>
You can delete the desired buttons by removing the corresponding line of code (eg: remove <%%INSERT_BUTTON%%> and the Save button will be gone)

Doing it this way of course will mean that any Appgini generated updates will have to be edited accordingly or they will be overwritten each time you update the files.

Hope that helps.

KSan
AppGini Super Hero
AppGini Super Hero
Posts: 252
Joined: 2013-01-08 20:17

Re: Removing AddNew and Delete buttons... Possible?

Post by KSan » 2013-05-06 06:46

Thank you so much!!! I keep forgetting the permissions control. D'oh! Job done. Thanks to you. Most appreciated.

Post Reply