You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 3, 2021. It is now read-only.
Hi,
Would it be possible to add a callback before the switch is toggled ?
Currently, I load data via Ajax from a DB. There is an boolean attribute for each line of this data, which is the model for each toggle switch. My use case is :
When you click on the toggle, it updates the attribute in DB. My problem is that the toggle is switched before the ajax request is done. In case of a servor error, the toggle is switched let's say to "yes", the ajax return an error, the toggle is switched back to "no".
I'd like to wait for the ajax response before any switch happens. How would you do that ? Watching my data is not useful there.
Thanks.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi,
Would it be possible to add a callback before the switch is toggled ?
Currently, I load data via Ajax from a DB. There is an boolean attribute for each line of this data, which is the model for each toggle switch. My use case is :
When you click on the toggle, it updates the attribute in DB. My problem is that the toggle is switched before the ajax request is done. In case of a servor error, the toggle is switched let's say to "yes", the ajax return an error, the toggle is switched back to "no".
I'd like to wait for the ajax response before any switch happens. How would you do that ? Watching my data is not useful there.
Thanks.
The text was updated successfully, but these errors were encountered: