PDA

View Full Version : Adding a menu to a div



chiphi13
2 Mar 2007, 9:03 AM
Is it possible to add a menu object directly to a div and always show it without adding it to a toolbar or button? I would like to add a menu as a navigator and always have the parent menu be shown. I have tried creating a new menu and using the 'el' property to tell it what dom object to attach it to:

var menu2 = new Ext.menu.Menu({
id: 'Menu2',
el: 'xMenu2',
items: [
new Ext.menu.CheckItem({
text: 'I like Ext',
checked: true,
checkHandler: onItemCheck
}),
new Ext.menu.CheckItem({
text: 'Ext for jQuery',
checked: true,
checkHandler: onItemCheck
}) ]
}
}
]
});

and then tried using the render() method, but nothing appears. Any advice would be helpful.

vajra
3 Mar 2007, 9:58 AM
This is exactly what I am trying to do....

Tried looking at the source code for menu and I think this should work.

Or should we be using 'show' or 'showAt' ? I tried them both with no luck.

Sure would love to ditch this YAHOO menu for the Ext menu

Thanks

Eli

fangzhouxing
23 Sep 2007, 7:32 PM
Is it possible to add a menu object directly to a div and always show it without adding it to a toolbar or button?

Has this problem solved?

Animal
23 Sep 2007, 11:32 PM
You need to use the Ext.ux.Menubar extension which provides "permanent" menus rendered into fixed containers.

http://extjs.com/learn/Extension:MenuBar

fangzhouxing
24 Sep 2007, 2:58 AM
animal, thank you for your reply.
Today I find MenuBar and use it very happy!
But I find a bug: 'align:right' does not have any effect in IE 6.
Can you help me?

mystix
24 Sep 2007, 3:01 AM
try


align:right !important;

fangzhouxing
24 Sep 2007, 4:54 PM
mystix,thank you for your reply, but your code has no effect.