0

on all my ajax requests, like grid data loading, Ext.Ajax.request ... I test if user is still connected. If not, the json response is different from I expect. If user is not connected, the return will be a json with auth => false. So everytime I get this, I want to have the same procedure : return to the login page.

How to do that, extend or refactor the load / ajax request callbacks ?

Thx !

Cyril F
  • 1,247
  • 3
  • 16
  • 31

1 Answers1

1

Ideally you should change your server to return 401 errors (Not Authorized). And then catch such error in global Ajax requestexecption event handler.

sha
  • 17,824
  • 5
  • 63
  • 98
  • ok, but the question is, how to define global Ajax requestexception ? – Cyril F Jun 01 '12 at 07:18
  • Take a look at this question: http://stackoverflow.com/questions/9682249/override-ext-data-connection-best-practice/9682966#9682966 - I posted code sample there – sha Jun 01 '12 at 10:05