我想根据行数动态设置包含Ext.Net中存储的面板的高度。
我有以下代码: -
<ext:Panel
ID="PanelOp12"
runat="server"
Layout="FitLayout"
AutoHeight="true"
Title="Business Report for the previous week" >
<AutoLoad Url="BusinessReport2.aspx" Mode="IFrame" ShowMask="true" Cls="abc" />
</ext:Panel>
我的businessReport2.aspx页面包含以下代码
<ext:GridPanel ID="GridPanel1"
runat="server"
StripeRows="true"
AutoHeight="true"
AutoWidth="true"
TitleCollapse="True">
<Store>
<ext:Store ID="Store1" runat="server">
<Reader>
<ext:JsonReader>
<Fields>
<ext:RecordField Name="s_artistname" />
<ext:RecordField Name="s_daysCover" />
<ext:RecordField Name="s_target"/>
<ext:RecordField Name="s_sales"/>
<ext:RecordField Name="s_variance"/>
<ext:RecordField Name="s_cust"/>
<ext:RecordField Name="s_unit"/>
<ext:RecordField Name="s_avgcustperday"/>
<ext:RecordField Name="s_aus"/>
<ext:RecordField Name="s_ipt"/>
<ext:RecordField Name="s_s_care"/>
<ext:RecordField Name="s_scare_percent"/>
<ext:RecordField Name="s_face"/>
<ext:RecordField Name="s_face_percent"/>
<ext:RecordField Name="s_t_hrs"/>
<ext:RecordField Name="s_t_prod"/>
</Fields>
</ext:JsonReader>
</Reader>
</ext:Store>
</Store>
<ColumnModel ID="ColumnModel1" runat="server">
<Columns>
<ext:RowNumbererColumn />
<ext:Column DataIndex="s_artistname" Header="Operator" Width="120px" Sortable="False" />
<ext:Column DataIndex="s_daysCover" Header="Days" Width="40px" Sortable="False"/>
<ext:Column DataIndex="s_target" Header="Target" Width="60px" Sortable="False">
<Renderer Fn="MyMoney" />
</ext:Column>
<ext:Column DataIndex="s_sales" Header="Sales" Width="60px" Sortable="False">
<Renderer Fn="MyMoney" />
</ext:Column>
<ext:Column DataIndex="s_variance" Header="Variance" Width="60px" Sortable="False">
<Renderer Fn="variance" />
</ext:Column>
<ext:Column DataIndex="s_cust" Header="Customers" Width="60px" Sortable="False" />
<ext:Column DataIndex="s_unit" Header="Units" Width="50px" Sortable="False" />
<ext:Column DataIndex="s_aus" Header="AUS" Width="60px" Sortable="False">
<Renderer Fn="AUS" />
</ext:Column>
<ext:Column DataIndex="s_ipt" Header="IPT" Width="60px" Sortable="False">
<Renderer Fn="IPT" />
</ext:Column>
<ext:Column DataIndex="s_s_care" Header="Skin$" Width="60px" Sortable="False">
<Renderer Fn="MyMoney" />
</ext:Column>
<ext:Column DataIndex="s_scare_percent" Header="Skin%" Width="60px" Sortable="False">
<Renderer Fn="skinPercentage" />
</ext:Column>
<ext:Column DataIndex="s_face" Header="Face$" Width="60px" Sortable="False" >
<Renderer Fn="MyMoney" />
</ext:Column>
<ext:Column DataIndex="s_face_percent" Header="Face%" Width="60px" Sortable="False">
<Renderer Fn="facePercentage" />
</ext:Column>
<ext:Column DataIndex="s_t_hrs" Header="Hours" Width="60px" Sortable="False"/>
<ext:Column DataIndex="s_t_prod" Header="Avg p/h" Width="60px" Sortable="False">
<Renderer Fn="HourlyProd" />
</ext:Column>
</Columns>
</ColumnModel>
<SelectionModel>
<ext:RowSelectionModel ID="RowSelectionModel1" runat="server" />
</SelectionModel>
<LoadMask ShowMask="true" />
</ext:GridPanel>
但它没有将高度视为自动或100%。 我不想在面板中滚动。 请帮帮我。
由于
答案 0 :(得分:4)
尝试使用ViewPort
<ext:Viewport runat="server" Layout="Border">
<Items>
<ext:Panel
ID="Panel1"
runat="server"
Layout="FitLayout"
Region="Center"
Title="Business Report for the previous week" >
<AutoLoad Url="CopyExt.NET.Default.aspx" Mode="IFrame" ShowMask="true" />
</ext:Panel>
</Items>
</ext:Viewport>