PDA

View Full Version : Can I add a toolbar to a panel ?



drissfoo
16 Feb 2012, 1:40 AM
I have a toolbar defined and I want to have that toolbar in a panel so here's what I did:


new Ext.Panel({ title: 'Panel with heavyweight toolbar',
renderTo: document.body,
layout: 'fit',
//width: 600,
//height: 400,
tbar: myToolbar
});
var myToolbar = new Ext.toolbar({
items: [
{
xtype: 'tbspacer'
},
.................
});


but this wont seem to work but when I defined the toolbar inside the panel worked just fine (copied the same toolbar code in the tbar config parameter)
If someone could guide me where my mistake is !

I also have a problem with fitting that toolbar to my panel!

mitchellsimoens
16 Feb 2012, 4:47 AM
It's Ext.Toolbar not Ext.toolbar. Also, is the Toolbar created before the Panel?

drissfoo
16 Feb 2012, 6:57 AM
yes it's capital 'T' i just misspelled that in writing this thread :s
but what was really my problem is the order you were right I have defined the toolbar after the panel that was my mistake now I switched the order and it's working
thank for helping me out again and again it's feels good to have quick answers =D>