View Full Version : Set title in a panel

28 Jan 2011, 7:41 AM

I want to set a title in a panel with some message on the left and some on the right. I am not able to do so.

I tried the following, but it didn't work.

panel.setTitle('<html><tr width="400px"><td align="left">Left</td><td align="right">Right</td></tr></html>');

Any clues?

28 Jan 2011, 7:50 AM
html tag? no table tag? It's always worth testing out your html before trying to use it.

panel.setTitle('<table width="400"><tr><td align="left">Left</td><td align="right">Right</td></tr></table>');

28 Jan 2011, 8:02 AM
thanks Fay, this works

28 Jan 2011, 8:05 AM
would you not just use a Toolbar and use the seperator '->' instead, i have found this excellent for putting items on left and right here is an example:

var modificationToolbar = { xtype: "toolbar",
items: [
{ xtype: "button",
text:"New Modification",
id: "addNewModification",
iconCls: "core-icon-add",
handler: just_clicked
{ xtype: "button",
text:"Register me",
id: "iWantToRegister",
iconCls: "core-icon-register",
handler: just_clicked
"->", //this forces right-justification xtype is called tbfill
anotherField //etc.. etc..