Put options in Select Component
Hi,
I have a Select component but I need to have the options taken from my database.
I can have all the options with one service, but how I can put all these in the Select component?
Thanks
Catch up wih the Appery.io community on our forum. Here you'll find information on the lastest questions and issues Appery.io developers are discussing.
https://forum.appery.io/
Hi,
I have a Select component but I need to have the options taken from my database.
I can have all the options with one service, but how I can put all these in the Select component?
Thanks
Hello Jordi,
You should map response parameters of your DB service to this select component: http://docs.appery.io/documentation/r...
ok thanks, this work!
Hi,
In the Select component need to create string Label with 2 parameters of the Response.
In the documentation http://devcenter.appery.io/documentat... this work with a simple label, but with Select component i have some problems, I don't know the name of the select value with the relatined value. How i can do this?
Thanks
Hi Jordi,
Not sure I understand you.
[quote:]I don't know the name of the select value with the relatined value. How i can do this? [/quote]
What do you mean here? Could you please post a screenshot?
Hi, i have a service that give me 3 Strings. (id, name and number)
I need to put these 3 Strings in a Select component. In the value the Id and in the label a new string like (name+" have number "+ number).
With the documentation, the mapping use JS. When I put the 2 items to the Label and make new js like:
return Appery("name ").val() +" have number "+ Appery("number").val();
This give me errors, undefined elements.
If I save in a local variable like this: http://devcenter.appery.io/documentat...
Possible will work, but i don't know the Select element that have the correct id
Can u help me?
Thanks
Hello Jordi,
You need to map field "id" from service to "value" property of selectmenu,
then map field "name" and "number" to property "label" and create js code for mapping:
codeif (value != undefined){
return element.text() + ' ' + value;
}
else{
return element.text();
}/code
Hi
This work, but i need to show more information like this.
This JS is called 2 times and only concatenate the 2 values.
There are any other option to create a correct string like name+" have number "+ number?
thanks for your time
Hello,
You can add JS handler to mappingа $[] on selectmenu, where set line that you want with the code:
pre
$(element).val(value.name+" have number "+ value.number);/pre