View Full Version : Perform some checks before loading a panel

7 Aug 2014, 6:51 AM

I'm using sencha architect 3.1 with extjs 4.2
There's something i can't understand. Brefly,

I have a project client-server. The normal flow would be to have a login window. With successfull login the user should see a main window with buttons and information retrieved from a server.

Ok. No problem, i understood how to make connection between client extj and a server to retrieve json datas.

since data have to be updated i need to perform a call-of-some-function-somewhere to update the datas in some panels of the main window, but actually i didn't understand how could i do that.

Here's why i said I'm using sencha architect. the main problem is that i cannot modify the code (that's incredible, but it has a reason, i know).
how can i do that?

thanks to everybody in advance.

7 Aug 2014, 8:30 AM
You can issue an ajax request, or use record.set(values) to issue use the proxy to send the request.
The server should then send back the updated record with a success: true

7 Aug 2014, 11:26 PM
Thanks scottmartin.

Yes, actually i already know how to do the ajax request, but it's not clear to me which event i should handle. Everything works fine when the event is raised from a button click.

Actually speaking, i would like to make such communication between the client and the server like every <tot> seconds. Let's say something like every thirty seconds. In some sense i'd like to make an automatic refresh on the panel.
Is there a way i may do that?

8 Aug 2014, 8:12 AM
You can use:
Ext.TaskManager.start({..}) and Ext.TaskManager.stop() to setup a interval timer. Just load the store on each interval.

25 Aug 2014, 5:21 AM
Thank you so much scottmartin.

the problem has been resolved.