PDA

View Full Version : [CLOSED] ST2 pr2 container.getHeight() always returns 'null'



luismerino
25 Nov 2011, 1:56 AM
I don't know for sure if I've found a bug, but seems like the internal value _height is not set?

Try this to reproduce the problem locally:


Ext.Viewport.add(Ext.create('Ext.Container', {itemId: 'zomg'}));
Ext.ComponentQuery.query('#zomg')[0].getHeight();
I was hoping that if the element is missing the height property in the constructor, it might as well default to return the element's dom height as rendered, e.g.:


Component.element.dom.offsetHeight

mitchellsimoens
25 Nov 2011, 9:46 AM
Thank you for the report.

Jamie Avins
28 Nov 2011, 9:52 AM
As the size can change at any time if not set, I don't think returning this as a default is proper.

luismerino
29 Nov 2011, 2:31 AM
Makes sense in this way. Maybe this bit of explanation could go into the docs? Let users know they can access dom height thru
Component.element.dom.offsetHeight

Cheers

Jamie Avins
29 Nov 2011, 8:55 AM
More than that, it needs to be measured with the help of Ext.util.SizeMonitor so you know when to make measurements. There will be a guide on it.