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
I am using the DirtyForms plugin in my current project & have had great success so far. My question has to do with the callCloseDialog, doCommit, and doProceed methods (and is likely specific to my use case, but who knows…)
I'll explain my use case -> I'm using the dirtyforms plugin to detect changes to my form, and if the user wants to navigate away from the form, (chooses to Proceed) I want to perform a simple "POST" to delete the current "item" from the database. Because of the asynchronous nature of javascript, the "POST" sometimes works, but sometimes the change in href causes the POST to be cancelled before it completes.
I've modified my copy of the DirtyForms plugin to use jQuery Promises (the "Close" callback is passed as a promise), and that seems to alleviate my problem. Is this something you can see being of value?
Jason
The text was updated successfully, but these errors were encountered:
This sounds like an interesting idea. My only concern is whether this feature can be added without breaking existing integrations.
Also, I am curious if this approach is something that would actually work or if you have the same race condition problem. Could you give it a shot?
In either case, I would be interested in a PR. Even if this doesn't end up in the codebase until the next major version, it would be a nice feature to have. But if you can work out a way to do it that is additive (non-breaking) to existing public interfaces, that would be preferable.
Hello!
I am using the DirtyForms plugin in my current project & have had great success so far. My question has to do with the callCloseDialog, doCommit, and doProceed methods (and is likely specific to my use case, but who knows…)
I'll explain my use case -> I'm using the dirtyforms plugin to detect changes to my form, and if the user wants to navigate away from the form, (chooses to Proceed) I want to perform a simple "POST" to delete the current "item" from the database. Because of the asynchronous nature of javascript, the "POST" sometimes works, but sometimes the change in href causes the POST to be cancelled before it completes.
I've modified my copy of the DirtyForms plugin to use jQuery Promises (the "Close" callback is passed as a promise), and that seems to alleviate my problem. Is this something you can see being of value?
Jason
The text was updated successfully, but these errors were encountered: