PDA

View Full Version : How to listen the events between two windows



url
27 Jun 2013, 7:51 AM
Hi All,

Now am able to open a new window by clicking on the button from other window. My requirement is I should be able to listen the events generated from the other window.

Can anybody help me How can i register the events from one window and how can i listen it in the other one



Thansk
Url

friend
27 Jun 2013, 8:11 AM
Are you using MVC?

url
27 Jun 2013, 10:52 PM
Ya am using MVC architecture

tvanzoelen
28 Jun 2013, 12:03 AM
You put a controller in between and implement the init function


init: function() {
this.control({
'window': {
show: this.onwindowShow
}
});
},

url
28 Jun 2013, 3:22 AM
@tvanzoelen

If i want to fire the event while showing the window then i can go for this approach but here my requirement is i want to fire the event from one window and want to handle it in the other window.

For example there is one button which is having a handler like
window.open('http://somepath/second.html'); which is opening a new window and in the viewport am showing a grid.

Now when the grid row is getting clicked then I want to do some action in the first window.

Similarly i want to do some action in the second window when a action executes successfully in first window

Thanks
Url

tvanzoelen
28 Jun 2013, 3:30 AM
Controllers and events are bound within the scope of a single Ext.Application. You can not catch easily events from an other browser window.

In that case you need to set up your own event handling mechanism. You can find an example overhere

http://stackoverflow.com/questions/4079280/javascript-communication-between-browser-tabs-windows