View Full Version : Opening a new window (not popup) from a button's event handler

8 Feb 2011, 12:51 AM
Hi guys,
This is probably trivial thing for most of you, but I can't find a way to open a new browser window (with a specified url). Just to be clear, I don't need window.open() because that method opens a popup window, and I can't use <a href='url' target='_blank'> because I specifically need that window to be opened on button click.

Thanks in advance,

8 Feb 2011, 4:03 PM
window.open opens a new browser window. What you are saying doesn't make sense. The case is that with the window open you can specify which tools in the borwser window you would like to have when you open a window.

8 Feb 2011, 11:41 PM
Calling window.open() does not work in safari, at least it does not work for me. Anyways, I found a way - specifying a html link tag in 'html' property of that button. That way it has a look and feel as a button, but its actually a link with target='_blank' attribute.

Thanks anyways.

25 Aug 2011, 11:11 AM
Well, an old thread. But in case anyone was wondering. Do effectively open a new window from a button click event, do this.

xtype: 'button',
text: 'newWindow!',
listeners: {
click: {
element: 'el',
fn: function() { window.open('http://www.yahoo.com');}

For whatever reason, the window.open will not fire if you try and call it using a handler/itemtap type configuration.