Is it possible to have JQuery Autocomplete work without using conventional id,label,value?
For instance, I do not wish to use:
[ { "id": "Botaurus stellaris", "label": "Great Bittern", "value": "Great Bittern" },
{ "id": "Asio flammeus", "label": "Short-eared Owl", "value": "Short-eared Owl" }]
but rather:
[ { "my_id": "Botaurus stellaris", "first_name": "Great Bittern", "last_name": "Great Bittern" },
{ "my_id": "Asio flammeus", "first_name": "Short-eared Owl", "last_name": "Short-eared Owl" }]
So like, what JQuery autocomplete normally takes id,value,label, can I make it to take my_id, first_name, last_name and make Jquery Autocomplete treat like same id,label,value?
This might be useful, when I don’t wish to modify data’s keys coming from a datasource, to display it on JQuery Autocomplete.
Never mind,
Found the answer from JQueryUI’s Autocomplete example source:
Here,
sourceis been assigned a function, that can convert and return any type of keys to required be converted to JQuery’s Autocomplete’sid,value,label.May be it helps some.