We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
How do I handle with select2 data that does not have id and text fields?
id
text
Data like this will work:
var data = [ { id: 0, text: 'enhancement' }, { id: 1, text: 'bug' }, { id: 2, text: 'duplicate' }, { id: 3, text: 'invalid' }, { id: 4, text: 'wontfix' } ]; $('#request_for_proposal_geo_path_counties').select2({ theme: "bootstrap", data: data });
But data like this won't:
var data = [ { "fips": "02", "name": "Alaska", "zip_codes": [], "counties": [], "population_0": 752680, "population_5": 698356, "population_18": 565916, "population_21": 534794 }, {
The text was updated successfully, but these errors were encountered:
Hi @cdesch,
Unfortunately, there is nothing to custom the shape of the results. It should have some kind of function hook in this place: https://github.com/lndl/select2_simple_form/blob/master/app/assets/javascripts/select2_simple_form/initializers.select2_simple_form.js#L89
If you want, you can do that change and I will merge it thankfully!
Sorry, something went wrong.
No branches or pull requests
How do I handle with select2 data that does not have
id
andtext
fields?Data like this will work:
But data like this won't:
The text was updated successfully, but these errors were encountered: