Is there a way to tell jQuery UI autocomplete which JSON indexes to use as a “label” and “value” if they are not the index names used in the JSON array?
The arif containing my search values looks like this (as Firebug is registered):
[ Object { id="12", name="Don Davis" }, Object { id="17", name="Stan Smith" } ]
I want to use "id" as a "label" and "name" as a "value", but I cannot figure out how to say the configuration object.
My array is contained in a local variable - there is no Ajax call there.
This answer to another question solves the problem by creating a hidden form input, but it seems likely that there is a cleaner way to handle this.
source
share