Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Display Condition for Buttons Topic is solved

Questions related to using nuBuilder Forte.
Post Reply
toms
Posts: 785
Joined: Sun Oct 14, 2018 11:25 am

Display Condition for Buttons

Unread post by toms »

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.
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: Display Condition for Buttons

Unread post by admin »

toms,

Just put it in the Javascript of the Form.

Code: Select all


if(nuAccessLevelCode()!='' || nuSubformObject('employee_bonuses_subform').rows.length > 2){
    $('#boss_button').remove();
}
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
toms
Posts: 785
Joined: Sun Oct 14, 2018 11:25 am

Re: Display Condition for Buttons

Unread post by toms »

Is this also valid for buttons under "User Home"?
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: Display Condition for Buttons

Unread post by admin »

toms,

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()

Steven
toms
Posts: 785
Joined: Sun Oct 14, 2018 11:25 am

Re: Display Condition for Buttons

Unread post by toms »

Steven, the question wasn't really how to do it, but where to place the code.

Options -> Form Properties -> Javascript
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: Display Condition for Buttons

Unread post by admin »

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
Post Reply