Page 1 of 1
How to hide an option of a selectmenu during mapping of a service?
Posted: Fri Jan 10, 2014 4:52 am
by Lux Smith
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.
How to hide an option of a selectmenu during mapping of a service?
Posted: Fri Jan 10, 2014 7:30 am
by Kateryna Grynko
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.
How to hide an option of a selectmenu during mapping of a service?
Posted: Mon Jan 13, 2014 10:24 pm
by Lux Smith
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.
How to hide an option of a selectmenu during mapping of a service?
Posted: Mon Jan 13, 2014 10:54 pm
by Igor
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.
How to hide an option of a selectmenu during mapping of a service?
Posted: Mon Jan 13, 2014 11:38 pm
by Lux Smith
I am storing a userId in a localstore variable
var userId = localStorage.getItem("_id");
And would like to hide this userID when the select menu is populated upon load event of the screen. I am matching it against the "_id" in the response.
How to hide an option of a selectmenu during mapping of a service?
Posted: Tue Jan 14, 2014 1:19 am
by Igor