PDA

View Full Version : Menu events not triggering



tvanzoelen
16 Jun 2009, 4:19 AM
Hi,

Is it right that events are not triggered on the Menu?
The render event is triggered only when you pushed the button.

Other thing, in IE7.0 if the app is embedded in a frameset the menuitem is not shown when you click the menu. See post http://www.extjs.com/forum/showthread.php?t=71365&highlight=Menu





<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>TestCase</title>

<meta http-equiv="pragma" content="no-cache"/>
<link rel="stylesheet" type="text/css" href="ext3/resources/css/ext-all.css"/>
<script type="text/javascript" src="ext3/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="ext3/ext-all-debug.js"></script>

</head>
<body>

<script type="text/javascript">

Ext.namespace('TestCase');

TestCase.app = function()
{

var menu1 = new Ext.menu.Menu({id:'menu1'});

menu1.on('click', function(t,e,r){alert('click');})
menu1.addText('menuitem'); //never shown in IE 7.0 when app runs in frameset

menu1.on('render', function(t, e, r){alert('render');});
menu1.on('enable', function(t){alert('enable');});
menu1.on('click', function(t, e, r){alert('click');});

var tb = new Ext.Toolbar({items: [{text:'Menu' , menu: menu1}]});

var panel1 = new Ext.Panel({id:'panel1',layout:'fit', tbar: tb});

panel1.doLayout();

return{
init: function(){
Ext.QuickTips.init();
var viewport = new Ext.Viewport({title: 'Test Case',layout: 'fit', items:[panel1]});
}
}; //end return
}();//end app

Ext.onReady(TestCase.app.init, TestCase.app);

</script>

</body>
</html>



and why is click not working? I need these events to make a workaround for that frameset bug. Am I doing something wrong? Plz.. help!

Animal
16 Jun 2009, 4:29 AM
You don't click a Menu, you click on a Menu's items.

Animal
16 Jun 2009, 4:30 AM
Why are you using a frameset? What application problem are you trying to solve? There are probably better ways of solving it.

tvanzoelen
16 Jun 2009, 4:40 AM
The problem is that we have registered an url somewhere and that server is redirecting to another server to a page like Default.aspx?client=3
The client wants to keep the registered url in the explorers addressfield, (that is asked very often). Our system Administrator is still not capable getting this issue solved.

But, you will see other people also will embed their apps in frames too.

We need to upgrade to extjs 3.0, before Miccrosoft is starting the upgrading to IE8.0automatically because extjs 2.2 looks scrambled on IE 8.0. Else I should do browser detection and serve extjs 2.2 to IE 7.0 users. Please save me these troubles..

tvanzoelen
16 Jun 2009, 5:19 AM
some links you can see the result of the code above

try this one with IE 7.0

http://aslas.artsystems.nl/3.0test/il/frametest.htm

and this one without

http://aslas.artsystems.nl/3.0test/il (http://aslas.artsystems.nl/3.0test/il/)

Animal
16 Jun 2009, 5:30 AM
You don't click on Menus, you click on their items.

I can't access those sites from work. Our proxy server doesn't like them for some reason.

Condor
16 Jun 2009, 5:33 AM
You'll need to host them on a server that is on port 80 instead of 85.

Most of us are behind proxy servers that only allow access to port 80.

tvanzoelen
16 Jun 2009, 6:28 AM
Port 80 for you.....!

within a frame

http://www.transpasonline.nl/3.0test/il/frametest.htm

and without

http://www.transpasonline.nl/3.0test/il/

Condor
16 Jun 2009, 6:39 AM
Well, there is something fundamentally different between the frameset and stand-alone version:
The stand-alone version is using standards compliant mode (it has a doctype).
The frameset version is using quirks mode (it has no doctype).

But there is something wrong here:
I have no idea why the menu won't display in IE7 quirks.
(but it works on IE6+8 quirks and IE6+7+8 standards)

tvanzoelen
16 Jun 2009, 7:13 AM
I tried to add the doctype in the frameset locally, but it makes no difference accept I see something small on the left side of the menu appearing that doesn't look like a menu - text - item to me.

I also added the doctype on the webserver .. hmm.. but the server is not adding it :(
But after all the doctype is still in the page that is within the frame so that can not be the issue here.

Animal
16 Jun 2009, 7:15 AM
Maybe post a screenshot of what you see?

A decently sized screenshot hosted at photobucket.com, not a forum attachment.

Condor
16 Jun 2009, 7:34 AM
The changes you've made (giving the frameset a doctype) seems to have fixed the problem.

(don't forget to hard-refresh your browser)

tvanzoelen
16 Jun 2009, 8:59 AM
Yes, it seems to be the problem. Now I am going to try to modify the frameset. This can be difficult because the framesets are in this way given by webhosts....and I can not modify it myself.

My thanks for your replies