PDA

View Full Version : [CLOSED] Store proxy events



thchuong
Sep 26, 2014, 11:28 AM
Hi there,

Is there any listeners to capture before request and request callback of store proxy?

Thanks in advance.

Daniil
Sep 26, 2014, 1:06 PM
Hi @thchuong,

There are BeforeLoad, BeforeSync, Load and Sync events on the Store. It fires before and after load and sync requests. Is it what you are looking for?

thchuong
Sep 26, 2014, 4:06 PM
Hi Daniil,

I did try all of them but

1. Sync and BeforeSync are not fired.
2. Load and BeforeLoad are always called whenever the page changed.

P/S: local paging

I just want to capture at before ajax request and request callback.

How can I do that?

Thanks,

Daniil
Sep 27, 2014, 8:47 AM
Understand.

If you use an AjaxProxy, I can suggest this:

Ext.data.AjaxProxy.override({
doRequest: function() {
alert("Before Request");
this.callParent(arguments);
},

afterRequest: function(request, success) {
alert("After Request");
}
});