PDA

View Full Version : Menu with a child menu?



kryo
13 Oct 2010, 5:04 PM
Hi @ll,

How can I make the following work? It seems when the child menu item is clicked, the parent menu disappears, and the child menu [item 1, item 2, item 3] still displays. HideOnClick option doesn't appear to affect the child menu. I'm using a semi-outdated version of Extjs (3.1.1) could that be it?

Sorry if this was answered before. Seems simple enough, but couldn't describe the problem in a way that Google could find something useful.



<html>
<head>
<script type="text/javascript">
Ext.onReady(function(){
new Ext.Panel({
renderTo: 'f00',
height: 200,
width: 400,
tbar: {
items: [{
text: 'Form With Menu', menu: {
showSeperator: false,
items: {
xtype: 'panel',
width: 300,
height: 200,
tbar: { items: [ { text: "Form Menu", menu: { items: [
{ text:"Item 1" },
{ text:"Item 2" },
{ text:"Item 3" },
] } }] }
}
}
}]
}
});
});
</script>
</head>
<body>
<div id="f00"></div>
</body>
</html>

kryo
13 Oct 2010, 6:57 PM
Thanks to the evant_ and snowsnakes: Solution is as follows:


Ext.onReady(function(){

var d = new Date();

new Ext.Panel({
renderTo: document.body,
height: 200,
width: 400,
tbar: {
items: [{
text: 'Form With Menu',
menu: {
allowOtherMenus: true,
showSeperator: false,
items: {
xtype: 'panel',
width: 300,
height: 200,
tbar: {
items: [{
text: "Form Menu",
menu: {
allowOtherMenus: true,
items: [{
text: "Item 1"
}, {
text: "Item 2"
}, {
text: "Item 3"
}, ]
}
}]
}
}
}
}]
}
});
});


Thanks again!