PDA

View Full Version : Periodically loading a Store with JSON data from Ajax request



RyanPays
27 Nov 2012, 5:53 PM
Hi,

Am new to ExtJS and have been asked to implement long polling for a project i am curretnly working on.

I have set up a POC that re-initialises a request and on timeout error to mimic the long polling to the server.

Am also utilising the echo feature to mock and AJAX request with JSFiddle.

I have created my POC:

http://jsfiddle.net/9Zx8H/2/

I am not proving the concept and need to do so!

Can you please help.

mitchellsimoens
29 Nov 2012, 12:58 PM
Instead of doing an Ext.Ajax request why not give your store a proxy and then load the store?

RyanPays
29 Nov 2012, 5:16 PM
Thanks for the reply.

I could not figure out how to implement long polling like in the original example with the proxy.

So set a long timeout and then on success or timeout re-init the request.

Agree that it would be far neater to implement a proxy but looking at the documentation i was not sure if i had access to success and failure callbacks to implement the long polling.