开发者

ExtJS: store, pagingToolbar and PHP session expire

Let's imagine you are on a page with an ExtJS grid with a pagingToolbar. Let's imagine that you remain on this page for a while and that during this time your PHP session expires. When you hit "Next page" or "reload" on the grid, the call to the server will fail since it will answer with something informing you that you are not allowed to get the information (since your session has expired).

H开发者_C百科ow can you handle that in the gridPanel in order to avoid it to get stuck? I hope this was clear enough..

Bye!


You'll need some sort of heartbeat mechanism, which means that you must periodically send an AJAX call to your server to keep the PHP session alive. If you're using Ext.direct you can simply make use of the Ext.direct.PollingProvider which is by far the most convenient way to implement such a heartbeat. If you're not using Ext.direct you can use Ext.TaskMgr or Ext.util.TaskRunner to call a function periodically in which you can simply issue an AJAX request.

The implementation details are left to the OP.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜