View Full Version : Menu css

28 Aug 2009, 6:16 AM
I have a toolbar that has a button, which in turn has a menu. When the button is clicked the menu pops up and has the following css applied to it: style="position: absolute; z-index: 15000; visibility: visible; left: 5px; top: 54px;"

Where does this style coming from? I'd like to change the left and top properties. What's the best way to do that?

28 Aug 2009, 8:04 AM
the style is automatical calculated by extjs

what do you want to do?

28 Aug 2009, 12:11 PM
I'd like to shift the menu so that the left edge is directly under the button. Basically setting left to something like 0px or 1px, whatever looks better.

29 Aug 2009, 2:54 AM
You can use the menuAlign and defaultOffsets config options to modify the menu position.

new Ext.Button({
text: 'Click me',
menuAlign: 'tl-bl',
menu: new Ext.menu.Menu({
defaultOffsets: [0, 0],
items: [{
text: 'Menuitem'
renderTo: Ext.getBody()