PDA

View Full Version : Ext.Window title width bigger than the window width (using setTitle)



jhuesos
8 May 2012, 12:04 AM
Setting a long title in a Ext.window is driving me crazy. I have a window component which I reuse all the time changing its content and title. So depending on the situation, one of the things I do is to set the width and height of the window, change its content and call setTitle() to change the title. In one scenario, the title is too long and I would like to have it in two lines (or more), but is shown in one line and is like its overflow is hidden. This is exactly my problem:

34975

I've tried to set the height of the title (container, span, ...) manually using CSS, but I guess the problem is that Ext in the moment renders the window, makes a wrong calculation of the elements and set wrong height and width values to elements inside the window component.

Any clue how I can solve this problem? Thanks in advance

sword-it
8 May 2012, 3:29 AM
Hi,
After setting the big title string, we need to find the length of container that contains the title text.
So here is the way to solve the problem by writing one line after calling setTitle() :




yourWindow.setTitle('big string');
yourWindow.setWidth(yourWindow.header.child('span').getWidth());



Here we are doing the following things:

Find the width of title-text container.
Then set that width to the window.
I think this will solve your problem. If you have any query, let me know.


Thanks