PDA

View Full Version : Useful trick: multiple toolbars in contentPanel!



violinista
28 Jun 2007, 2:14 AM
I made a little trick, in need to put multiple toolbars in one content panel, maybe it'll be useful for someone(for me is much useful):



var tb = new Ext.Toolbar(panel.el);
tb.add("First row:",{
text:"Button 1"
},'-',{
text:"Button 2"
});

var tb2container=Ext.DomHelper.append(tb.el,{tag:'div',id:Ext.id()},true);

var tb2 = new Ext.Toolbar(tb2container);
tb2.add("Second row:",{
text:"Button 3"
},'-',{
text:"button 4"
});

You can attach any number of toolbars, following this pattern.

A screenshot is also attached.

If someone has other (better) way to to this, please post here and let me know.

Note: Ext.DomHelper.append(...) appends a <div /> tag. I suppose this is not a problem, since this div isn't closed-I use it only as separator. :D

skyey
9 Jul 2007, 8:30 AM
i need,tks

lastid
10 Jul 2007, 2:22 AM
Thanks, I need this too. :)

violinista
10 Jul 2007, 2:39 AM
You're welcome :D

andrei.neculau
17 Jul 2007, 8:23 AM
Request: Why not add '--' or '\n' or 'hr' as a text shortcut for creating a horizontal divider like '-' for Separator?

manugoel2003
17 Jul 2007, 9:29 AM
nice little trick.... does it work with gridPanels and treePanels as well??..... what abt nested layouts???

ntulip
18 Jul 2007, 7:42 AM
nice little trick.... does it work with gridPanels and treePanels as well??..... what abt nested layouts???

It does not.