PDA

View Full Version : [ADDED] [V1.0] AjaxMethods addition



state
Jul 16, 2009, 4:35 PM
I would like to see a param that is able to run after a success or failure when the method returns. Kinda works like a finally of a try...catch.

Example:


Coolite.AjaxMethods.DoSomethingCool(param, param, {
success: function(result) {
// TODO do something
},
failure: function(result) {
// TODO do something
},
finally: function(result) {
// TODO: this runs AFTER the success or failure fires.. kind of a clean up type thing, or do some common
// function after the succes or failure runs
}
});

jchau
Jul 16, 2009, 4:37 PM
I agree! I usually show a loadmask before firing off an AjaxMethod. Currently, I have hide the loadmask in the success AND failure handler.

state
Jul 16, 2009, 4:47 PM
Yeah. Exactly why I want it.

I have several timers running on my application. I stop the timers so that long database process don't cause a bunch of queued requests doing basically the same thing.

After a success or failure, I hide a mask and restart the timers. I have to do this pretty much for every success/failure.

This would help with code size reduction and to make sure that things run in the order you want them.

Thanks.

geoffrey.mcgill
Jul 16, 2009, 4:49 PM
Ya, I like this idea as well and ran into a scenario the other day where this would have been helpful.

Vladimir
Aug 31, 2009, 1:32 PM
Hi,

This feature (called Complete) is implemented and will be available in 1.0 release. Applies for ajax events and ajax methods

state
Aug 31, 2009, 1:57 PM
Oh, nice!

Thanks.