Page 1 of 1

Hide components when "undefined"

Posted: Thu Jul 02, 2015 1:31 pm
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"?


Hide components when "undefined"

Posted: Thu Jul 02, 2015 8:27 pm
by Serhii Kulibaba

Hello Matt,

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


Hide components when "undefined"

Posted: Thu Jul 02, 2015 11:16 pm
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.


Hide components when "undefined"

Posted: Mon Jul 06, 2015 4:16 pm
by Matt Simoncavage

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


Hide components when "undefined"

Posted: Fri Jul 10, 2015 1:49 am
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.


Hide components when "undefined"

Posted: Mon Nov 16, 2015 1:32 am
by asid

Hi Matt

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