Matt Simoncavage
Posts: 0
Joined: Thu Jun 04, 2015 7:10 pm

Hide components when "undefined"

I use database list services to show database contents and have been using the following code to hide a component if it appears as 'undefined' (caused by the column being empty for that particular item):

if (value == undefined) {
element.hide();
} else {
element.show();
}
return value;

The solution above is working great. My question is: Can I use the same solution to hide other components as well? For example, the code above says "hide 'component_1' when 'component_1' appears as undefined". How can I make it say "hide 'component_2' when 'component_1' is undefined"?

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Hide components when "undefined"

Hello Matt,

Sure, you can hide/show any component: https://devcenter.appery.io/documenta...

Matt Simoncavage
Posts: 0
Joined: Thu Jun 04, 2015 7:10 pm

Hide components when "undefined"

I modified the code to look like the following:

if (value === undefined) {
Apperyio('component_2').hide();
} else {
Apperyio('component_2').show();
}
return value;

However, it's hiding the one component that does not appear as 'undefined' and showing the others, which is the exact opposite of what I want to happen. Any idea why this might be happening? I'm running the javascript during mapping to the text of the component.

Matt Simoncavage
Posts: 0
Joined: Thu Jun 04, 2015 7:10 pm

Hide components when "undefined"

Hi, checking to see if anyone had a chance to take a look at this yet?

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Hide components when "undefined"

HI Matt,

Please specify more details:

1 Mapping.
2 Where you use this code(on what link).
3 What you expect?
4 What actually you have.

Some screenshots are welcome.

Thanks.

asid
Posts: 0
Joined: Sun Aug 09, 2015 8:01 pm

Hide components when "undefined"

Hi Matt

Did you sort this, I need the same solution?
Thanks

Return to “Issues”