-
Notifications
You must be signed in to change notification settings - Fork 20
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
Add automatic generation of select options to form view #84
Comments
This has to do these qualities of the select:
|
This seems to be the biggest problem with non-string values in the form model. Using numbers in the form model and putting the "matching" values in the dom will cast them as strings and it won't match. Adding data-stickit-bind-val is what Katy did, but apparently re-rendering hit issues. Her pull request is an attempt to use the recommended "selectOptions" but still utilizing the DOM. Perhaps using the formView's "fields" attribute might be a way to auto-generate the options. But alas, all of these have issues with keeping and defining attributes of the options (like classes) |
Stickit works better with selects if you pass a selectOptions hash when creating the bindings:
http://nytimes.github.io/backbone.stickit/#selectoptions
Otherwise you need to add a data-stickit-bind-val attribute to the DOM and it doesn't always re-render correctly. A good way to solve this would be to add support for auto-generating the select options hash when the form view generates the other bindings.
The text was updated successfully, but these errors were encountered: