I'm using the autocomplete function of materialize , how do I use a local JSON and fill select
from this? In the official documentation, there is only one using an object.
data: {
"Apple": "null",
"Microsoft": "null",
"Google": "http://placehold.it/250x250"
}
... and what I want to use is something like this ...
data: [{
"field": "null",
"field2": "a",
"field3": "b",
"field4": "c"
},
{
"field": "null",
"field2": "a",
"field3": "b",
"field4": "c"
},
{
"field": "null",
"field2": "a",
"field3": "b",
"field4": "c"
}]
... but it does not work, I already try formatting the information at value
, label
, as well as at jQueryUI , but it does not work either ...
var prog = $.map(this._programasService.getProgramas(), function (i)
{
return {
label: i.field2,
value: i.field3
};
});