Page 1 of 1

mapping and returning something that sets item as visible

Posted: Fri Feb 13, 2015 12:26 am
by Ryein Goddard

I want to set something as visible. What do I return so it is set as visible.

For example when mapping I can add JS inside my js I would do.

if(value == "blah")
{
return true;
}


mapping and returning something that sets item as visible

Posted: Fri Feb 13, 2015 3:01 am
by Bruce Stuart

That's the concept for sure ... Depending on the default value of the control ... Be sure to return false if your blah condition evaluates to the negative ...


mapping and returning something that sets item as visible

Posted: Fri Feb 13, 2015 11:32 pm
by Ryein Goddard

I am using console.log and no matter what I do the values are always undefined for

value and element

The thing is I know it is working because it works fine.

I should add I am trying to set the visibility on a json REST return array.

value[n].value == "blah" is what I am trying to use.


mapping and returning something that sets item as visible

Posted: Mon Feb 16, 2015 4:48 am
by Yurii Orishchuk

Hi Ryein,

So you want to set visibility of single component in accordance to the some element in the response?

If so it's better to use new event handler for "success" event with action "Run javascript".

And inside this JS you can use "data" variable as response array.

For example:

pre

if(data[n] && data[n] == "blah")
Apperyio("componentToManageName").hide()
else
Apperyio("componentToManageName").show();

/pre

Regards.