autocomplete with hidden info attached to option
So I'd like to use the JQuery-UI autocomplete. But there needs to be hidden metadata attached to each option, which is NOT shown in either the list (label) or the text field once selected (value). But IS available in the select method -- I'd actually like to fill a hidden form field with it.
Now, the autocomplete demos provide a demo that does this: The "remote datasource" example does not display the bird scientific name in the select list OR the text field once selected, but DOES have it available in the select handler, to write it to the log.
So this seemed good, like I could do what I'm doing. However, the "remote datasource" example uses a remote json datasource -- if I'm using the 'callback' source instead... I don't seem to be able to duplicate this. The callback source can return an array of objects, but ONLY 'label' and 'value' properties seem to make it through anywhere -- if I try adding an 'id' property, it's not there in the select handler for me to look at. But if you use a 'remote datasource' json, instead of the callback, then any properties in the json objects are maintained for the select handler to look at?
There seems to be a mismatch in functionality here. Anything I'm missing? Is this a bug? Mis-design? Is there another way to do what I need I'm missing?