I was wondering how to format the source to allow this example :
I want to be able to autocomplete the field either by entering the name, or ref, or address which match a single object
So this is mainly a formatting question
id 1 = { name = "test", ref = "1337", address = "123 street" }
2 = { name = "john", ref = "2", address = "oxford street" }
Here’s what i’ve done so far, but it’s not working. I know that i’m missing something really obvious.
var autocompleteFields = new Array();
for (var i in db._data.installations)
{
smallArray = [db._data.installations[i].name, db._data.installations[i].reference, db._data.installations[i].address];
autocompleteFields.push(smallArray);
}
$("#input_search_installation_autocomplete").autocomplete({
source: autocompleteFields
});
});
Thanks.
Maybe it’s not so trivial solution but it works:
Code: http://jsfiddle.net/2AUN8/6/
Hope it helps.