Hide components when "undefined"

This forum contains topics that were moved from Get Satisfaction
Matt Simoncavage
Posts: 0
Joined: Thu Jun 04, 2015 7:10 pm

Hide components when "undefined"

Post by Matt Simoncavage »

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: 147
Joined: Tue Aug 27, 2013 1:47 pm

Hide components when "undefined"

Post by Serhii Kulibaba »

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"

Post by Matt Simoncavage »

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"

Post by Matt Simoncavage »

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"

Post by Yurii Orishchuk »

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"

Post by asid »

Hi Matt

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

Post Reply