giorgos
December 15, 2015, 11:28am
1
Hi, I need to have a simple select box with options loaded by the server.
However, the server returns a list of objects with fields id and title. How can I specify to the widget that options should display the ‘title’ attribute?
I have tried the setup
var select = {
view: ‘select’,
options: {
template: ‘#title #’,
data: ‘/api/json/’
}
}
but it doesnt work.
Thank you in advance
A simple select box always requires an array of options with the properties id
and value
(instead of the title
in your sample).
Here’s an example: http://docs.webix.com/samples/13_form/01_controls/02_select.html
But you can use the richselect with the following configuration:
{
view:"richselect", options:{
template:"#title#",
url:"/api/json/ " //not data:""
}}
giorgos
December 18, 2015, 10:26am
3
Above doesn’t work for me but what works is:
{
view:"richselect",
options:{
body:{
template:"#title#",
url:"/api/json/"
}
}
}
(notice the ‘body’ attribute)