my url http://domain.de/get_data
contains a list of data.
[
{
"id": 1,
"text": "test one"
},
{
"id": 2,
"text": "test two"
},
{
"id": 7,
"text": "test seven"
},
{
"id": 10,
"text": "test ten"
}
]
with select2 (jQuery) i fetch the data and output them in a <select>
html.
this.select.select2({
placeholder: this.save_input.val(),
ajax: {
url: 'http://domain.de/get_data',
dataType: 'json',
processResults: function(data){
return {
results: data
}
}
}
});
Is there any option to set the id 7
as an selected item in this.select.select2 output?
At the moment, the select
has no start value.