我有一个弹出窗口,其中有一个标签面板,下方有“保存”按钮。其中一个选项卡包含一个网格面板和“添加新行”按钮。最初,gridpanel没有行。当网格面板的高度达到某个像素值或某些像素值时,如何显示垂直滚动条。行添加? 代码如下所示:
<ext:Window ID="Window1" runat="server" Height="600px" Width="400px" Title="Popup Window">
<Items>
<ext:TabPanel ID="tabMain" runat="server" Width="400px" Height="300px">
<Items>
<ext:Panel ID="pnlItem" runat="server" Title="Item">
<Items>
<ext:Container runat="server">
<Content>
<div>
...
...
</div>
</Content>
</ext:Container>
</Items>
</ext:Panel>
<ext:Panel ID="pnlQuantities" runat="server" Title="Quantities">
<Items>
<ext:Container runat="server">
<Content>
<div>
Grid Below:
</div>
<div>
<ext:GridPanel ID="gridQuantities" runat="server" Width="400px" Height="200px" Header="false">
<Store>
..........
..........
</Store>
</ext:GridPanel>
<ext:Button ID="btnAddRow" runat="server" Text="Add New Row" Icon="Add">
<Listeners>
<Click Fn="addNewRow" />
</Listeners>
</ext:Button>
</div>
</Content>
</ext:Container>
</Items>
</ext:Panel>
</Items>
</ext:TabPanel>
<ext:Container runat="server">
<Items>
<ext:Button ID="btnSave" runat="server" Text="Save" Icon="Disk"></ext:Button>
</Items>
</ext:Container>
</Items>
</ext:Window>
我该怎么做才能帮忙。
答案 0 :(得分:1)
谢谢Lorenz Meyer。我只需要将 AutoScroll:true 添加到我的GridPanel。并且我将 MaxHeight 设置为200,因此每当网格达到200px高度时,就会出现垂直滚动条。
<ext:GridPanel ID="gridQuantities" runat="server" Width="400px" MaxHeight="200" Header="false" AutoScroll="true">
<Store>
..........
..........
</Store>
</ext:GridPanel>