Skip to Content
0

How can i hide a button clicking on the same button and showing an hidden chart or container?

Nov 06, 2016 at 05:32 PM

79

avatar image

I wold like to use javascript for showing and hiding clicking by a button menu.

in the "on click" section of the button i wrote different kind of code:

the "getelementbyid" to get the buttonid and the "style.duspaly = 'none' for changing visibility but with no outcomes.

When i run the app and i clic on the button nothing happens. I checked on firebug and i do not get any warning or error.

What can i do?

example code commented:

//var el = document.getElementById('BUTTON_DISTRIBUTION_button');
// Hide
BUTTON_DISTRIBUTION_button.setVisible(false);
//var id = document.getElementById('__layout20');
//id.style.display = 'none';

//id.onClick("BUTTON_DISTRIBUTION_button.style.display = 'none'");


//element.style.display = 'none';

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

5 Answers

Poovarasan Boopalan Nov 06, 2016 at 06:01 PM
0

Hi Marco,

. In the "on Click" section of button you can use simply use the below code to hide the button.

me.setVisible(false);

The "me" is used to call name of the component inside it's own scripting area like "on Click" section in button.

To show an another component, you can simply use the code as given below. Give name of the component and make it visible by giving property value true

INFOCHART_1.setVisible(true);

No need to complicate the coding in design studio by accessing ID in java script, you can use the name given to the component in the application and give require property values to it.

Thanks,

Poovarasan

Share
10 |10000 characters needed characters left characters exceeded
Marco Pagliotta Nov 07, 2016 at 08:56 AM
0

Thanks! It works!

If i would like to set display to "none". (e.g. Display: 'None') ?

I saw that if i have a button has set visible = 'false' from properties area, i'm not able to click on that invisible button.

the visibility set to false means also that is not clickable?

Thanks again

Marco

Share
10 |10000 characters needed characters left characters exceeded
Poovarasan Boopalan Nov 07, 2016 at 09:04 AM
0

Hi Marco,

Yes the button will not be available for interaction when it's visibility is set to false. You can make it visible through some other event in your application.

Thanks,

Poovarasan

Share
10 |10000 characters needed characters left characters exceeded
Marco Pagliotta Nov 07, 2016 at 09:36 AM
0

So there is not other way to click on an INFOCHART or a GRID LAYOUT and trigger an event such as :

GRID_LAYOUT_6.setHeight(500);

or

INFOCHART_6.setHeight(500);

I put this code in INFOCHART "on select" area but with no response, GRID LAYOUT has not any "on select" area.

I thought about an invisible button but now i know it's not the right solution.

Thank you

Share
10 |10000 characters needed characters left characters exceeded
Poovarasan Boopalan Nov 07, 2016 at 10:14 AM
0

Hi Marco,

Grid layout don't have any selection event. But you can use chart selection event to set height.

You may have given chart height value as auto in property window, if the value is in auto you cannot change it in scripting.

You can change it only when it has a constant value.

Thanks,

Poovarasan

Share
10 |10000 characters needed characters left characters exceeded