I am using a selectmenu and have mapped a database service to populate the drop down options, but need to skip a couple of options based on some criteria. I have tried to add javascript in the selecmenu mapping but it does not seem to work. Thanks.
I am using a selectmenu and have mapped a database service to populate the drop down options, but need to skip a couple of options based on some criteria. I have tried to add javascript in the selecmenu mapping but it does not seem to work. Thanks.
Hi Lux,
If you want to do this in Select component mapping, you can use: pre$(element).hide();/preOr anywhere in your app:pre$(Appery("mobileselectmenu").find("option")).hide();/preWhere 'mobileselectmenu' is a name of Select component,
'i' is a number of component option.
Sorry, I am not able to use either of these code snippets to hide a select option. I need to hide an option based on a specific option value. During Select component data mapping I tried to use the $(element).hide(); and it didn't work. Then I tried to use the second snippet in the success event of the service and that also didn't work.
Hello,
Another way is exclude this elements from service response using DB query. Could you show us your service response values and values which you want to exclude.
What you need to do is :
create query service;
Map localStorage variable into request tab-where clause;
"Add JS" on where clause:
pre
code
return '{"_id":{$ne:"'+value+'"}}';
/code
/pre
Flowing tutorials will help:
http://docs.appery.io/tutorials/build...
http://docs.appery.io/documentation/b...