-
Notifications
You must be signed in to change notification settings - Fork 248
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
fixed bug: AutoCompleteSelectMultipleField does not honor 'widget' parameter #14
Comments
I left a comment on the commit. I wouldn't describe this as a bug, since the main feature of the field is to work with its own tightly integrated widget. customizations like setting placeholder or css attributes should be done another way, not by changing the entire widget. the widget is the core of the application. I think there is a simpler way to accomplish what you want to do, and letting a custom widget get passed in basically breaks the application. |
Hi, good to see the surge of activities in this branch :) For my usage, I wanted the flexibility of extending the widgets and substitute them so the widget override option worked better for me. I'd be happy to put in placeholder-only support though and put in a pr when I can find some time. Thanks for maintaining this package. |
an attributes dict would be the best. then it could be used for all kinds of things like data-something="something" |
Did you thought about adding something like https://github.com/Polyconseil/django-ajax-selects/commit/bccbcde7dea5170eeaf5749a3307b4639b58db8f ? |
That's a four year old fork with all the licensing information removed. Django widgets already support attrs={'placeholder': 'Placeholder Text'} so there is no need for a special hook. https://docs.djangoproject.com/en/1.8/ref/forms/widgets/ widget is supported so you can create the widget with any attrs you want http://www.w3schools.com/tags/tag_input.asp maybe including a widget_attrs argument just like plugin_options would be a On Mon, Apr 20, 2015 at 11:43 AM Kirill Zaborsky [email protected]
|
Yes, that was the point - I don't see how could I set placeholder with e.g. |
AutoCompleteSelectMultipleField
overwrites itskwargs['widget']
with its default AutoCompleteSelectMultipleWidget so there it's not possible to customize the widget in your form definition.This seems to be a bug since the other ajax-select fields:
AutoCompleteSelectWidget
andAutoCompleteField
both allow substituting the default widget with your own, just like django. Widget substitution is useful especially when you want to change placeholder attribute or CSS attributes of the default widget.I have fixed it in this commit taivo@a24dc27 but not sure how to submit a second pull request since I've already have one in the pipeline.
Last but not least, I find this package to be extremely useful. I wasted a lot of time getting autocomplete done on an adhoc basis, and even more time trying generalize all the adhoc code. Good thing I found ajax-select before going too far into reinventing the wheel. So thanks for maintaining this tool!
The text was updated successfully, but these errors were encountered: