PDA

View Full Version : [solved] How do I add text in the middle of a toolbar



christa
24 Sep 2009, 12:55 AM
Hello,

I am trying to create a toolbar with a menu on the left side, a username on the right side and the date in the middle. Right now, I use a spacer to make the date move to the middle of the toolbar, however this won't work if you resize the browser window. Is there a way to place an item in the middle of the toolbar?

Thanks

rblon
24 Sep 2009, 5:46 AM
Did you try to use hbox layout with 'flex: 1' for the spacer elements?

Disclaimer: I am relatively new to ExtJS. I think using a hbox layout should make it possible, but there might be a better / easier method.

christa
28 Sep 2009, 1:36 AM
Thanks a lot!

I used hbox layout with flex: 1, changed text-aling accordingly and added


monitorResize: true, // relay on browser resize

in the toolbar configuration so that the toolbar resizes along with the browser's window and it works just fine.