Hi,
I have a label that is populated with an email from rest service
if no email is available, the service returns "undifined"
How can I hide the book button if service returns "undifined"
thx
Hello! Add JS in mapping to hide element. For example:
codeif (!value) {
element.hide();
}/code
I don't understand
As its the book btn I want to hide if label returns "undefined", do I not need to add js on page load
Sorry, code can looks like this:
preif ( !value ) {
$(element).hide(); // hiding current component
Appery( "component_name" ).hide(); // hiding other component
}/pre
You need add this code as Add JS for mapped value in Service.
Hi Marina,
can you help with this issue
this issue and the profile screen are the only probs stopping apple submission
please help, I'm drowning here
Working on it.
1) Can you post sample response?
2) Don't add this code codeAppery( "component_name" ).hide();/code in mapping because after first value is mapped all other values will be hidden.
If we understand correctly you map response array to Collapsible block. If you want to hide element in block (not that one you map), but another one in this block then you need to find nesessary element in this block. Try this code:
codef (!value) {
var $block = $(element).parents('[data-role="collapsible"]');
$block.find('[dsid=component_name]').hide();
}
return value;/code
If you need to hide element you use for mapping then the following code would be enough:
codeif (!value) {
$(element).hide();
}
return value;/code
OK Marina,
yes I am tryng to hide a button in the collapsible block if the service returns "undefined" mapped to an invisible label in the block.
would this be right code
codef (!value) {
var $block = $(element).parents('[data-role="collapsible"]');
$block.find('[dsid=bookbutton]').hide();
}
undefined;/code
thanks!
brill Marina, that works great
thanks for all your help, you are the one!