PDA

View Full Version : Retain menu button after item click



AgentSmith
29 Oct 2009, 11:15 AM
The following code gives me a mouse over dropdown menu. Only problem is, when I click on the item, the menu button itself goes away. I tried a number of attributes but to no avail. Any suggestions?

Thanks,

AS



<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="../../ext/resources/css/ext-all.css" />
<script type="text/javascript" src="../../ext/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="../../ext/ext-all.js"></script>

<style type="text/css">
.x-menu.x-menu-horizontal .x-menu-list {
overflow: hidden;
}
.x-menu.x-menu-horizontal .x-menu-list .x-menu-list-item {
float: left;
}
.x-menu.x-menu-horizontal .x-menu-list .x-menu-list-item .x-menu-item-arrow {
background: none;
}
</style>

<script type="text/javascript">
/* Path to the blank image must point to a valid location on your server. */
Ext.BLANK_IMAGE_URL = '../../ext/resources/images/default/s.gif';

/* Main application entry point. */
Ext.onReady(function(){
new Ext.menu.Menu({
renderTo: 'toolbar',
floating: false,
hidden: false,
enableScrolling: false,
cls: 'x-menu-horizontal',
subMenuAlign: 'tl-bl?',
items: [{
text: 'Menu1',
menu: [{
text: 'Item1'
},{
text: 'Item2'
},{
text: 'Item3'
}]
},{
text: 'Menu2',
menu: [{
text: 'Item1'
},{
text: 'Item2'
},{
text: 'Item3'
}]
}]
});
}); // Ext.onReady()
</script>
</head>

<body>
<div id="toolbar" />
</body>
</html>

Jaitsu
29 Oct 2009, 11:17 AM
does the button element still exist after clicking on it?

AgentSmith
30 Oct 2009, 5:11 AM
Not sure if it does or not. My goal is for it to act as a toolbar menu with mouse over drop downs.

Animal
30 Oct 2009, 5:15 AM
You mean you don't want the Menu to hide when you click on an Item?

http://www.extjs.com/deploy/dev/docs/?class=Ext.menu.Item&member=hideOnClick

Animal
30 Oct 2009, 5:23 AM
Make the horizontal menu plain: true to avoid that incised line.

Jaitsu
30 Oct 2009, 5:32 AM
i kinda get confused when you call it a 'menu button'