PDA

View Full Version : Ext.Window size problems with different browsers



estesbubba
20 May 2010, 12:48 PM
We have some dialogs (Ext.Window) with a few form fields and buttons and don't give it a size. When submitting the dialog's form, if there is an error, an originally hidden component is shown with the error. In FF and Opera, the dialog sizes just fine and resizes automatically when the error is shown. In Chrome and Safari, the dialog is several times wider than the viewport. Giving a width fixes that but when an error is shown the dialog doesn't resize. Giving a height and width works but I like to avoid that in GUI work if possible. I feel it's always better to let the components calculate size based on their children. Plus their is a bunch of whitespace below the buttons unless there is an error - doesn't look professional.

I've search the API, Google and the forums with no luck. I've attached some pics of the too wide problem and also too short (buttons hidden) after showing the error message. Any ideas?

PS - Haven't even tried in IE yet...don't know if I want too...

estesbubba
27 May 2010, 1:11 PM
So does everyone give sizes to their windows or is there a tip to allowing them to size dynamically across all browsers?

darthwes
27 May 2010, 3:09 PM
viewport

estesbubba
28 May 2010, 6:23 AM
Can you explain some more? Our application does use a viewport.

mitchellsimoens
28 May 2010, 6:25 AM
Normally I like to set the dimensions myself as this happens. You can always get the screen size by


Ext.getBody().getSize();

darthwes
28 May 2010, 1:52 PM
that's the weak way of getting screen size. the cool kids name their viewport and use the getWidth and getHeight. functions to size things relative to the users screen...Ext.getBody().getSize() is usually too big, so i either grab by id or look up in viewport and then get the widths and heights i want, but in this instance mitchell's solution is more succinct.

mitchellsimoens
29 May 2010, 12:58 PM
I must of stopped reading or skipped over the part about the op having a viewport. Not everyone uses a viewport and guess I assumed on that one...