-
-
Notifications
You must be signed in to change notification settings - Fork 190
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
Using Bootstrap switches for checkboxes #46
Comments
Found a better way tom implement this in |
My current improved implementation is to add a switch class to main the Python file:
and use the switch with:
and also extend the checkbox rendering in
The only thing missing is that the rendered switch is not responding to mouse clicks, for the rest it works. Who can help me fix this? The result with documentation, I can put in a PR then. |
@greyli, specifically I need to get the rendering from:
to (I think):
|
Or perhaps not, the documentation at https://getbootstrap.com/docs/4.4/components/forms/#switches uses:
|
Please see (and upvote) also pallets-eco/wtforms#545 |
If you support this, perhaps you can also say something about pallets-eco/wtforms#545 |
@greyli If you think it would be possible to trigger rendering of a switch instead of a checkbox via a parameter in kwargs as oppose to that separate subclass, please let me know which approach to take. |
I think this implementation is OK, but how you solve the mouse click issue? |
In The mouse issue is still there, unfortunately. |
Still looking for an impementation which doesn't need |
Does this PR #159 solve this issue? |
@greyli the rendering of a checkbox has become more complex. I would like to render a switch using the form-switch class and is not as trivial as my earlier attempts. What would currently be the best path to solve this? Via a parameter in For the user, that would be the most easy was, not having to create a switch subclass. |
Ah, found a working version. Will make a PR. |
Implemented in #174. |
I would like to have a Bootstrap switch rendered for a checkbox. Ideally, I would like to enable this via a parameter when creating a
BooleanField
, but that is for later.I have used the following lines to replace what is in form.html in order to get a switch rendered.
This renders a switch, see screenshot.
However, the switch is not responding to mouse clicks. How can this be fixed?
Second question is how to trigger this via a parameter in
BooleanField
?The text was updated successfully, but these errors were encountered: