0

I want to set the height of a panel which contains store in Ext.Net dynamically based on the number of rows.

I am having the following code:-

 <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>

Where my businessReport2.aspx page has the follwing code

<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>

But it is not taking the height as auto or 100%. I don't want a scroll in the panel. Please help me.

Thanks

4

1 回答 1

4

尝试使用视口

<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>
于 2012-07-25T08:41:16.523 回答