View Full Version : Handle browser refresh event for navigate to current window

28 Feb 2014, 1:43 AM
Hi everyone,
I want handle browser refresh event through this i want navigate user to current window, i have multiple form sub forms, when user working on particular form and suddenly refresh the browser, after refresh user should see the current window on which user working.

Thanks & Regards,

3 Mar 2014, 1:32 AM

3 Mar 2014, 1:39 AM
you can try using the onbeforeunload event on window. there you can store the currently opened window in a cookie and when the page is reloaded, you can use that value from cookie to find out which window was opened last and then show it. for a guide on how to use cookies, read this:


3 Mar 2014, 8:07 PM
Thanks, how about Ext.State.Manager

3 Mar 2014, 11:48 PM
i havent used it much but it works similarly. the values are stored in the cookies. you have to set stateful: true and stateId for that component. but you have to check which state values are supported for windows.

4 Mar 2014, 12:46 AM
okay, let me check. thanks a lot

4 Mar 2014, 4:25 AM
i have problem with applyState, i have viewport with card layout into that i have 4 panel's view. Now i want to navigate those panel view which was activate before refresh browser i have tried

applyState: function (state) {
if (!state.activeID) state.activeID = 0;
this.viewPort = Ext.ComponentQuery.query('viewport')[0];
var t = this.viewPort.getLayout().setActiveItem(state.activeID);

but it not found viewport