Hi,
This is a follow-up question to the locked thread "Display Condition for Objects" http://forums.nubuilder.cloud/viewtopic.php?f=19&t=9232
Where's the best place to control the visibility of buttons on nuhome? E.g. to make certain buttons invisible if nuAccessLevelCode() does not equal globeadmin.
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.
Display Condition for Buttons Topic is solved
Re: Display Condition for Buttons
toms,
Just put it in the Javascript of the Form.
It won't do anything when the Form is being run as a Browse.
$('#boss_button') will just be ignored because it's not there.
Steven
Just put it in the Javascript of the Form.
Code: Select all
if(nuAccessLevelCode()!='' || nuSubformObject('employee_bonuses_subform').rows.length > 2){
$('#boss_button').remove();
}
$('#boss_button') will just be ignored because it's not there.
Steven
-
- Posts: 785
- Joined: Sun Oct 14, 2018 11:25 am
Re: Display Condition for Buttons
toms,
You can do it on any Form you have access to.
If anything has an id you can remove it with...
Steven
You can do it on any Form you have access to.
If anything has an id you can remove it with...
Code: Select all
var id = 'run_customer';
$('#' + id).remove()
-
- Posts: 785
- Joined: Sun Oct 14, 2018 11:25 am
Re: Display Condition for Buttons
Steven, the question wasn't really how to do it, but where to place the code.
Options -> Form Properties -> Javascript
Options -> Form Properties -> Javascript
Re: Display Condition for Buttons
OK,
As you have figured out, it goes in the Javascript Section of the Form you want it to run on...
http://wiki.nubuilder.net/nubuilderfort ... Javascript
Steven
As you have figured out, it goes in the Javascript Section of the Form you want it to run on...
http://wiki.nubuilder.net/nubuilderfort ... Javascript
Steven