Jan 19, 2009, 3:37 PM
[CLOSED] Help With Confirmation Window
Is there a way to initiate an ajax event in javascript?
For example, I want to pop up an ExtJS confirmation dialog in a button listener before the ajax event is fired. So I create a listener which fires before the listener that would start the ajax event. I show the confirmation window and return false in my listener because I don't want to fire the ajax event until I'm sure the user wants to continue.
The ExtJS uses a callback function when they've clicked OK or cancel because a javascript version (like ExtJS uses) can't block (not like using alert() or confirm()). But by the time I'm in the callback, I've missed the boat.
So I was wondering if there's a way to use confirmation and then in the callback call the handler that will invoke the ajax event?
For now I've had to resort to calling fireevent() inside my callback with a parameter that my client-side listener looks for and if it exists will allow the event to propagate and not show the confirmation dialog. But that seems real ugly to me. I was hoping for a more elegant solution.
Thanks!
For example, I want to pop up an ExtJS confirmation dialog in a button listener before the ajax event is fired. So I create a listener which fires before the listener that would start the ajax event. I show the confirmation window and return false in my listener because I don't want to fire the ajax event until I'm sure the user wants to continue.
The ExtJS uses a callback function when they've clicked OK or cancel because a javascript version (like ExtJS uses) can't block (not like using alert() or confirm()). But by the time I'm in the callback, I've missed the boat.
So I was wondering if there's a way to use confirmation and then in the callback call the handler that will invoke the ajax event?
For now I've had to resort to calling fireevent() inside my callback with a parameter that my client-side listener looks for and if it exists will allow the event to propagate and not show the confirmation dialog. But that seems real ugly to me. I was hoping for a more elegant solution.
Thanks!