PDA

View Full Version : Problem loading URLs/windows from menu in Internet Explorer (IE)



bryan10
23 Feb 2012, 4:38 AM
Hello,
I have created a menu (see below) - when user selects an item,
a new URL should be loaded in to the window.


It works successfully using Chrome and Firefox but not when using
IE.
When I use IE, the URLs (new windows) are not shown following clicking
on menu item.
With IE if, e.g. I invoke browser development tools then the URLs/windows
are displayed.
I have tried replacing window.open... with window.location.href =....
When I use an href in the 'configMenu' item, it works e.g. for google.com
but when I use a link to a route (java play) which brings up another
ext js 4 page, the page is displayed but the 'loading' timer appears
and stays there - loading doesn't complete.


Was wondering if you would know what is happening, provide a solution?

Thank you,
bryan



Ext.Loader.setConfig({enabled:true});


var genHandler = function(menuItem) {


var win = null;

console.log("genHandler");

switch (menuItem.text)
{

case "Configuration":
win = "http://www.google.com";
break;


case "Adjustment Types":
win = "adjusttype";
break;


}

if (win)
window.open(win,"_self");

// window.location.href = win

console.log("window.open");
};




var configMenu = Ext.create('Ext.menu.Menu', {
id: 'configMenu',
items: [
{
text: 'Adjustment Types',
// href: 'adjusttype',
handler : genHandler
}

]
});


var maintenanceMenu = Ext.create('Ext.menu.Menu', {
id: 'maintenanceMenu',
style: {
overflow: 'visible'
},
items: [
{
text: 'Configuration',
handler : genHandler,
menu: configMenu
}
]
});




var tb = Ext.create('Ext.toolbar.Toolbar', {
width : 1000,
items: [


{
text: 'System Management',
menu: maintenanceMenu,
margin : '0 20 0 0'
}


]
});


Ext.define('menupanel', {
extend: 'Ext.panel.Panel',
width : 1365,
height : 33,
alias: 'widget.menupan',
tbar : tb
});




Ext.define('BILL.view.HomeViewport', {
extend: 'Ext.container.Viewport',
height : 700,
layout: 'border',

initComponent: function() {





this.items = [
{
xtype: 'menupan',
region: 'north',
height: 33,
layout: 'fit'
},

{ region: 'center',
xtype: 'panel',
split: true,
title: 'Home',
html: 'Home Page'
}


]
this.callParent();
}

});


Ext.application({


name: 'BILL',

launch: function() {

var v = new BILL.view.HomeViewport();


v.show();

}
});

mitchellsimoens
23 Feb 2012, 8:25 AM
First, you shouldn't use Ext.create before the launch method. You also shouldn't use already instantiated components as items in an Ext.define call.

So your issue is that window.open isn't opening a new window? Is IE preventing it?

bryan10
28 Feb 2012, 4:53 AM
Hello,

Thank you for your reply.

IE isn't preventing window.open. When I run F12 developer tools the menu works ok.
I also tried disabling pop-up blocker.

Wondering if there are any other suggestions?
It's not difficult to reproduce the problem

Thank you,
bryan

bryan10
28 Feb 2012, 5:27 AM
I should have mentioned - version of I.E. I am using: 9.0.8112.16421

Thank you,
bryan