View Full Version : [1.0] gridpanel autoheight

Feb 12, 2010, 7:44 AM

In 0.8.2 i had a grid that had the initial value of height="0", as i was adding data to it, i would set autoHeight = "true" and then call syncSize();

In 1.0 it doesnt work anymore.

#{GridPanel1}.autoHeight = true; #{GridPanel1}.syncSize();


Feb 12, 2010, 8:19 AM

Please read the following note from ExtJS documentation

A grid requires a width in which to scroll its columns, and a height in which to scroll its rows. These dimensions can either be set explicitly through the <tt>height (http://www.extjs.com/deploy/dev/docs/output/Ext.BoxComponent.html#Ext.BoxComponent-height)</tt> and <tt>width (http://www.extjs.com/deploy/dev/docs/output/Ext.BoxComponent.html#Ext.BoxComponent-width)</tt> configuration options or implicitly set by using the grid as a child item of a Container (http://www.extjs.com/deploy/dev/docs/output/Ext.Container.html) which will have a layout manager (http://www.extjs.com/deploy/dev/docs/output/Ext.Container.html#Ext.Container-layout) provide the sizing of its child items (for example the Container of the Grid may specify <tt>layout (http://www.extjs.com/deploy/dev/docs/output/Ext.Container.html#Ext.Container-layout):'fit'</tt>).

Feb 12, 2010, 10:09 AM
From what i understand, what i said is right

<ext:GridPanel AutoExpandColumn="ColumnNome" Height="0" Border="false" HideHeaders="true"
ID="GridPanel1" Cls="cell-border" runat="server" StoreID="StoreCnae" Width="450">

I want to set this grid autoHeight property later, when I hide a window

<ext:Button runat="server" Text="Ok">
<Click Handler="#{GridPanel1}.autoHeight = true; #{GridPanel1}.syncSize(); #{Window1}.hide();" />