PDA

View Full Version : Ext.lib.Ajax as Observable



dj
9 May 2007, 3:14 PM
haibijon suggested here (http://extjs.com/forum/showthread.php?p=29679#post29679) that Ext.lib.Ajax could need some Events like "requeststarted", "requestcomplete" or "requestfailure".

I think that would be really helpful to implement something like a global load-indicator or a global error handler.

jack.slocum
9 May 2007, 3:24 PM
Ext.lib.Ajax is a private Ext -> Lib class that could change at any time. I have been deliberating over creating a public Ext.Ajax or something with a friendly programming interface (and events). Do you think it would be more useful than using the underlying lib's transport functionality?

dj
9 May 2007, 3:53 PM
Ext.lib.Ajax is private? I use it all the time in my code :">

An Ext.Ajax class would be fine but i think i have overlooked Ext.data.Connection - basically what i need when making AJAX-calls.

But Ext.data.Connection/Ext.Ajax do not give a way to intercept all AJAX calls made by Ext. That's what i want to implement a global loading indicator (like the loading indicator of the browser in the top-right corner) and a global error handler that can intercept invalid server responses.

Reading what i wrote i realize that it is a little bit confusing - seems to be the right time to go to bed :)
Have a look at http://www.prototypejs.org/api/ajax/responders - that is what i want.

jack.slocum
10 May 2007, 12:51 PM
I know what you mean. I started the class at some point (it's in my experimental folder) and it has Observable events like you mentioned.

dj
10 May 2007, 2:50 PM
Then I will do what I like to do most: Daily make a "svn up" and explore what for new cool features are waiting to be used. ;)