-
Notifications
You must be signed in to change notification settings - Fork 365
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enabling Autocomplete to return different values for lable and value #231
Comments
To clarify, is your use case for selecting an association id by another field on the associated object? E.g.
Then you could assign the products.category_id field by autocompleting on the category name? |
This request has nothing to do with associations, I don't understand the confusion here. The problem is that the JSON returned from the autocomplete search has the same value for the "value" field as it does for the "label" field. The "value" field should be that of the object id by default and at least allow an option to choose which field to use. Normally, users will want to submit the id value of the selected item, not the label value. |
Although an option to choose the fields is very useful wouldn't changing the default behaviour break the existing applications ? |
@paulwalker, I understand this could be a useful feature to have, however not as the default behavior. As @manusajith pointed out, this would break existing applications. If someone would like to add this functionality in a way that maintains backwards compatibility and issue a pull request we are certainly open to that. |
I don't see why the json returned always has to have the same value for label and value. A lot of actions would be simplified if I could return a column of my choosing (for e.g id) in the value field and search column in the label field.
The text was updated successfully, but these errors were encountered: