PDA

View Full Version : about toolbar with menus?



franklt69
26 Mar 2007, 4:34 AM
Hi I wonder is possible to do a menu like the toolbar with menus examples, but the toolbar is in the bottom and the menu upwards?

kind regards
Frank

Animal
26 Mar 2007, 5:39 AM
Yes, just set



defaultAlign : "bl-tl?",


in the config of the Menu that you add.

franklt69
26 Mar 2007, 4:47 PM
Animal I did it and I don't watch any effect set or remove defaultAlign : "tl-bl?" in the menu:

var menu = new Ext.menu.Menu({
id: 'mainMenu',
defaultAlign : "tl-bl?",
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
}),
.................

var feedtb = new Ext.Toolbar('mystatus-tb');
feedtb.add({
cls: 'x-btn-text-icon bmenu', // icon and text class
text:'Start',
menu: menu // assign menu by instance
});


the toolbar is inside a contentpanel in south region
layout.add('south', new Ext.ContentPanel('status', {toolbar: feedtb, fitToFrame:true}));

the menu appear ok but the button have an image (arrow to down), is possible to change this image to indicate the menu will open upwards?

kind regards
Frank

kind regards
Frank

JeffHowden
26 Mar 2007, 4:50 PM
the menu appear ok but the button have an image (arrow to down), is possible to change this image to indicate the menu will open upwards?

Yes, but you shouldn't as all menus (regardless of whether they open up or down) indicate that they open off a split button by way of an arrow pointing down. If you feel that you really must change it, I'm sure you can figure out a means by way of some custom CSS.

Animal
26 Mar 2007, 10:56 PM
OK, I misread the source (I'm in the same situation as you: No documentation yet, so it's down to reading the code so I can learn enough to send some documentation comments in to Jack)

Try



pos: ""tl-bl?",

sj137
17 Jan 2008, 2:40 AM
I'm trying to make the menu align to the right and i've tried :

defaultAlign :"tr-br?",
subMenuAlign :"tr-br?",
pos :"tr-br?",

but nothing seems to work...

has anyone figured this out.

my code:



items:[{
region:"center",
autoScroll:'true',
overflow: 'visible',
//subMenuAlign :"tr-br?",
tbar:[
addressBar,
{
text:"Hyperlinks",
// defaultAlign :"tr-br?",
// subMenuAlign :"tr-br?",
pos :"tr-br?",
menu:[highlightLinks, listSelectedLinks1, listLinks1]}
/*, Edit*/
]
}]

Animal
17 Jan 2008, 3:09 AM
What is that? The elements in the config Array for a Toolbar each become buttons (or spacers) in that toolbar.

What are you doing?

sj137
17 Jan 2008, 5:19 AM
I'm creating buttons on the toolbar and i saw from one of the code samples in the examples folder that you can auto create a menu with (see below) where button* are Ext.Action's



tbar:[
button0,
{text:"myMenu",menu:[button1, button2]},
{
cls: 'x-btn-icon',
icon:"images/shared/icons/fam/application_go.png",
handler:function() {//do something},
tooltip: 'some text'
}
]

Animal
17 Jan 2008, 5:30 AM
The defaultAlign of the menu config object is what you set. Use a menu config object with items and defaultAlign, not an array as the button's menu config.

sj137
17 Jan 2008, 8:13 AM
Cheers Animal,

PS why couldn't i find info about this "menu:" option in the api...?

ie tbar:[menu:[buttons]]...