EXT.NET Toolbar GridPanel自动宽度和高度的解决方案,引入Viewport

EXT.NET Toolbar GridPanel自动宽度和高度的解决方案,引入Viewport_第1张图片

隐藏左侧时,右边的列表也自动宽度,

EXT.NET Toolbar GridPanel自动宽度和高度的解决方案,引入Viewport_第2张图片

<ext:Viewport ID="ViewPort1" runat="server">
        <Items>
            <ext:BorderLayout ID="BorderLayout1" runat="server">
                <North MarginsSummary="0" AutoHide="true">
                </North>
                <Center MarginsSummary="0 5 0 5">
                    <ext:Panel ID="Panel2" runat="server" Title="会议室" Icon="HouseStar" Layout="Fit">
                        <TopBar>
                            <ext:Toolbar ID="Toolbar1" runat="server">
                                <Items>
                                    <ext:Button ID="btnAdd" runat="server" Text="新增" Icon="ApplicationAdd">
                                        <Listeners>
                                            <Click Handler="AddRoom()" />
                                        </Listeners>
                                    </ext:Button>
                                    <ext:ToolbarSeparator>
                                    </ext:ToolbarSeparator>
                                    <ext:Button ID="btnEdit" runat="server" Text="修改" Icon="ApplicationEdit">
                                        <Listeners>
                                            <Click Handler="EditRoom()" />
                                        </Listeners>
                                    </ext:Button>
                                    <ext:ToolbarSeparator>
                                    </ext:ToolbarSeparator>
                                    <ext:Button ID="btnDelete" runat="server" Text="删除" Icon="ApplicationDelete">
                                        <Listeners>
                                            <Click Handler="DeleteRoom()" />
                                        </Listeners>
                                    </ext:Button>
                                    <ext:ToolbarSeparator>
                                    </ext:ToolbarSeparator>
                                    <ext:Button ID="btnRefresh" runat="server" Text="刷新" Icon="Reload" ToolTip="重载列表">
                                        <Listeners>
                                            <Click Handler="#{GridPanel1}.reload();" />
                                        </Listeners>
                                    </ext:Button>
                                </Items>
                            </ext:Toolbar>
                        </TopBar>
                        <Items>
                            <ext:GridPanel ID="GridPanel1" runat="server" StripeRows="true" StoreID="Store1"
                                TrackMouseOver="true">
                                <ColumnModel ID="ColumnModel1" runat="server">
                                    <Columns>
                                        <ext:Column Header="名称" DataIndex="F_NAME" />
                                        <ext:Column Header="地址" DataIndex="F_ADDRESS" />
                                        <ext:Column Header="容量" DataIndex="F_CAPACITY" />
                                        <ext:Column Header="是否要审批" DataIndex="F_ISAPPROVAL">
                                            <Renderer Fn="change" />
                                        </ext:Column>
                                        <ext:Column Header="审批人" DataIndex="F_ADMIN_NAME" />
                                        <ext:Column Header="创建人" DataIndex="F_CREATED_NAME" />
                                        <ext:DateColumn Header="创建日期" DataIndex="F_CREATED_ON" />
                                    </Columns>
                                </ColumnModel>
                                <SelectionModel>
                                    <ext:CheckboxSelectionModel ID="CheckboxSelectionModel1" runat="server" SingleSelect="true">
                                        <Listeners>
                                            <RowSelect Handler="if (#{pnlSouth}.isVisible()) {#{Store2}.reload();}" Buffer="250" />
                                        </Listeners>
                                    </ext:CheckboxSelectionModel>
                                </SelectionModel>
                                <LoadMask ShowMask="true" Msg="加载中..." />
                                <BottomBar>
                                    <ext:PagingToolbar ID="PagingToolbar1" runat="server" PageSize="10" AutoWidth="true" />
                                </BottomBar>
                            </ext:GridPanel>
                        </Items>
                    </ext:Panel>
                </Center>
                <South Collapsible="true" Split="true" MarginsSummary="0 5 5 5">
                    <ext:Panel ID="pnlSouth" runat="server" Title="关联资源" Height="200" Icon="HouseLink"
                        Layout="Fit">
                        <Items>
                            <ext:GridPanel ID="GridPanel2" runat="server" StripeRows="true" StoreID="Store2"
                                TrackMouseOver="true" AutoWidth="true">
                                <ColumnModel ID="ColumnModel2" runat="server">
                                    <Columns>
                                        <ext:NumberColumn Header="序号">
                                        </ext:NumberColumn>
                                        <ext:Column Header="名称" DataIndex="F_NAME" />
                                        <ext:Column Header="编码" DataIndex="F_CODE" />
                                        <ext:Column Header="数量" DataIndex="F_QUANTITY" />
                                    </Columns>
                                </ColumnModel>
                                <SelectionModel>
                                    <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" SingleSelect="true" />
                                </SelectionModel>
                                <LoadMask ShowMask="true" Msg="加载中..." />
                            </ext:GridPanel>
                        </Items>
                        <Listeners>
                            <Expand Handler="#{Store2}.reload();" />
                        </Listeners>
                    </ext:Panel>
                </South>
            </ext:BorderLayout>
        </Items>
    </ext:Viewport>

 

你可能感兴趣的:(gridPanel)