PDA

View Full Version : Automatically wrap long window titles



sandhya.agarwal
19 Jul 2009, 11:22 PM
Hello,

Is there a way to automatically wrap long window titles.

Thanks,
Sandhya

Condor
19 Jul 2009, 11:33 PM
The window css and height calculation code are not made for that. You would have to fix both.

sandhya.agarwal
20 Jul 2009, 12:27 AM
Thanks Condor. You mean I must override the css (for instance x-window-header-text) ?

Condor
20 Jul 2009, 12:38 AM
I'm confused. I just tested and the window title already wraps:

Ext.onReady(function(){
new Ext.Window({
title: 'Very very very very very very very very very long title',
width: 200,
height: 100
}).show();
});

Did you mean something different?

sandhya.agarwal
20 Jul 2009, 12:50 AM
sorry...I see that it already works too. The problem is with a custom CSS class I am using. The class is something like mentioned below :

.test {
color: #757575;
font-size: 1.4em;
float: left;
padding: 0 5px 0 30px;
}

steffenk
20 Jul 2009, 12:55 AM
with your example the title will break in second line. I think the question was to behave like os windows where there is an hidden overflow.

there is the possibility with "white-space:nowrap;" but as it is a span inside the div it will lead to problems with the buttons.

Condor
20 Jul 2009, 1:02 AM
float:left won't wrap, unless you give it a fixed width.

You'll need to add code to the onResize method to update the title div with a width.