Aug 17, 2014, 5:42 AM
[CLOSED] Layout - Gridpanel / Panel in Window
Hi,
I am trying to use the panels to do a layout on a new window that will consists of two parts, a header with search controls and a grid with results. I want the controls to stretch through the layout of the window. After fiddling with the panel and gridpanel controls for a number of hours, I managed to create the layout but the gridpanel control did not show a scrollbar even if I set the autoscroll property to true.
I am using ASP.NET. I went over the provided layout examples but couldn't figure out solution. Is there an example of such an arrangement I can use.
I am trying to use the panels to do a layout on a new window that will consists of two parts, a header with search controls and a grid with results. I want the controls to stretch through the layout of the window. After fiddling with the panel and gridpanel controls for a number of hours, I managed to create the layout but the gridpanel control did not show a scrollbar even if I set the autoscroll property to true.
I am using ASP.NET. I went over the provided layout examples but couldn't figure out solution. Is there an example of such an arrangement I can use.
<ext:Window
ID="winAddNewProductEntry" runat="server" Title="Add Products" Icon="ApplicationFormAdd" Height="500" Width="800" Hidden="true" ClientIDMode="Static"
BodyStyle="background-color: #fff;" BodyPadding="3" Modal="true" Layout="TableLayout">
<LayoutConfig>
<ext:TableLayoutConfig Columns="1" />
</LayoutConfig>
<Items>
<ext:Panel ID="pnSearchControls" runat="server" Title="Search Criteria">
<Content>
<table>
<tr>
<td>Keywords<br />
<ext:TextField ID="txtSearchProduct" runat="server" MinWidth="100" />
</td>
<td>Level 1<br />
<ext:ComboBox ID="cbLevel1" runat="server" Editable="false" Width="280px" QueryMode="Local" TriggerAction="All" EmptyText="Select Level 1" IDMode="Static">
<Listeners>
<Select Handler="#{cbLevel2}.clearValue(); #{stcbLevel2}.reload();" />
</Listeners>
</ext:ComboBox>
</td>
<td>Level 2<br />
<ext:ComboBox ID="cbLevel2" runat="server" Width="280px" TypeAhead="true" QueryMode="Local" ForceSelection="true" TriggerAction="All"
DisplayField="name" ValueField="id" EmptyText="Select Level 2" ValueNotFoundText="No Values" IDMode="Static" Enabled="false">
<Store>
<ext:Store runat="server" ID="stcbLevel2" AutoLoad="false" OnReadData="LevelsRefresh" IDMode="Static">
<Model>
<ext:Model runat="server" IDProperty="Id">
<Fields>
<ext:ModelField Name="id" Type="String" />
<ext:ModelField Name="name" Type="String" />
</Fields>
</ext:Model>
</Model>
<Parameters>
<ext:StoreParameter Name="Level" Value="2" Mode="Value" Action="read" />
</Parameters>
</ext:Store>
</Store>
<Listeners>
<Select Handler="#{cbLevel3}.clearValue(); #{stcbLevel3}.reload();" />
</Listeners>
</ext:ComboBox>
</td>
</tr>
<tr>
<td>Category<br />
<ext:ComboBox ID="cbProductTypes" runat="server" Editable="false" MinWidth="100" />
</td>
<td>Level 3<br />
<ext:ComboBox ID="cbLevel3" runat="server" Width="280px" TypeAhead="true" QueryMode="Local" ForceSelection="true" TriggerAction="All"
DisplayField="name" ValueField="id" EmptyText="Select Level 3" ValueNotFoundText="No Values" IDMode="Static" Enabled="false">
<Store>
<ext:Store runat="server" ID="stcbLevel3" AutoLoad="true" OnReadData="LevelsRefresh" IDMode="Static">
<Model>
<ext:Model runat="server" IDProperty="Id">
<Fields>
<ext:ModelField Name="id" Type="String" />
<ext:ModelField Name="name" Type="String" />
</Fields>
</ext:Model>
</Model>
<Parameters>
<ext:StoreParameter Name="Level" Value="3" Mode="Value" Action="read" />
</Parameters>
</ext:Store>
</Store>
<Listeners>
<Select Handler="#{cbLevel4}.clearValue(); #{stcbLevel4}.reload();" />
</Listeners>
</ext:ComboBox>
</td>
<td>Level 4<br />
<ext:ComboBox ID="cbLevel4" runat="server" Width="280px" TypeAhead="true" QueryMode="Local" ForceSelection="true" TriggerAction="All"
DisplayField="name" ValueField="id" EmptyText="Select Level 4" ValueNotFoundText="No Values" IDMode="Static" Enabled="false">
<Store>
<ext:Store runat="server" ID="stcbLevel4" AutoLoad="true" OnReadData="LevelsRefresh" IDMode="Static">
<Model>
<ext:Model runat="server" IDProperty="Id">
<Fields>
<ext:ModelField Name="id" Type="String" />
<ext:ModelField Name="name" Type="String" />
</Fields>
</ext:Model>
</Model>
<Parameters>
<ext:StoreParameter Name="Level" Value="4" Mode="Value" Action="read" />
</Parameters>
</ext:Store>
</Store>
<Listeners>
<Select Handler="#{cbLevel5}.clearValue(); #{stcbLevel5}.reload();" />
</Listeners>
</ext:ComboBox>
</td>
</tr>
<tr>
<td>
<ext:Button runat="server" Text="Search Products" Icon="Application">
<DirectEvents>
<Click OnEvent="AddRow_Click" />
</DirectEvents>
</ext:Button>
</td>
<td>Level 5<br />
<ext:ComboBox ID="cbLevel5" runat="server" Width="280px" TypeAhead="true" QueryMode="Local" ForceSelection="true" TriggerAction="All"
DisplayField="name" ValueField="id" EmptyText="Select Level 5" ValueNotFoundText="No Values" IDMode="Static" Enabled="false">
<Store>
<ext:Store runat="server" ID="stcbLevel5" AutoLoad="true" OnReadData="LevelsRefresh">
<Model>
<ext:Model runat="server" IDProperty="Id">
<Fields>
<ext:ModelField Name="id" Type="String" />
<ext:ModelField Name="name" Type="String" />
</Fields>
</ext:Model>
</Model>
<Parameters>
<ext:StoreParameter Name="Level" Value="5" Mode="Value" Action="read" />
</Parameters>
</ext:Store>
</Store>
</ext:ComboBox>
</td>
</tr>
</table>
</Content>
</ext:Panel>
<ext:GridPanel ID="gpCatProductEdit" runat="server" AutoScroll="true" Layout="VBoxLayout">
<LayoutConfig>
<ext:VBoxLayoutConfig Align ="StretchMax" />
</LayoutConfig>
<Store>
<ext:Store runat="server" AutoSync="false" ShowWarningOnFailure="true">
<Model>
<ext:Model runat="server" IDProperty="Id" Name="SelectedProductCatEntryItem" ClientIdProperty="Id" IDMode="Static">
<Fields>
<ext:ModelField Name="Id" Type="string" />
<ext:ModelField Name="Quantity" Type="Int" DefaultValue="1" />
<ext:ModelField Name="Duration" Type="Int" DefaultValue="1" />
<ext:ModelField Name="RequestTypeID" Type="Int" DefaultValue="1" />
<ext:ModelField Name="Category" Type="String" />
<ext:ModelField Name="Code" Type="String" />
<ext:ModelField Name="ProductIdName" Type="String" />
<ext:ModelField Name="PrepaymentCharge" Type="Float" />
<ext:ModelField Name="OneTimeCharge" Type="Float" />
<ext:ModelField Name="RecurringCharge" Type="Float" />
<ext:ModelField Name="EndDate" Type="String" />
<ext:ModelField Name="EffectiveDate" Type="String" />
<ext:ModelField Name="Level1" Type="String" />
<ext:ModelField Name="Level2" Type="String" />
<ext:ModelField Name="Level3" Type="String" />
<ext:ModelField Name="Level4" Type="String" />
<ext:ModelField Name="Level5" Type="String" />
<ext:ModelField Name="Manufacturer" Type="String" />
<ext:ModelField Name="Model" Type="String" />
<ext:ModelField Name="DataPackage" Type="String" />
<ext:ModelField Name="StoragePackage" Type="String" />
<ext:ModelField Name="ColorPackage" Type="String" />
</Fields>
</ext:Model>
</Model>
<Listeners>
<Exception Handler="
var error = operation.getError(),
message = Ext.isString(error) ? error : ('(' + error.status + ')' + error.statusText);
Ext.net.Notification.show({
iconCls : 'icon-exclamation',
html : message,
title : 'EXCEPTION',
autoScroll : true,
hideDelay : 5000,
width : 300,
height : 200
});" />
</Listeners>
</ext:Store>
</Store>
<ColumnModel>
<Columns>
<ext:Column runat="server" Flex="1" Text="Quantity" DataIndex="Quantity" MinWidth="70" Align="Center">
<Editor>
<ext:NumberField runat="server" MinValue="1" MaxValue="1000" />
</Editor>
</ext:Column>
<ext:Column runat="server" Flex="1" Text="Duration" DataIndex="Duration" MinWidth="80" Align="Center">
<Editor>
<ext:NumberField runat="server" AllowDecimals="false" MinValue="1" MaxValue="1000" />
</Editor>
</ext:Column>
<ext:Column runat="server" Text="Request Type" Flex="1" DataIndex="RequestTypeID" MinWidth="120">
<Renderer Fn="reqTypeRenderer" />
<Editor>
<ext:ComboBox runat="server" QueryMode="Local" Editable="false" StoreID="reqTypeStore" DisplayField="Name" ValueField="ID" />
</Editor>
</ext:Column>
<ext:Column runat="server" Text="Category" Flex="1" DataIndex="Category" MinWidth="70" />
<ext:Column runat="server" Text="Code" Flex="1" DataIndex="Code" MinWidth="130" />
<ext:Column runat="server" Text="Name" DataIndex="ProductIdName" MinWidth="250" />
<ext:NumberColumn runat="server" Text="Total First Month" Flex="1" DataIndex="PrepaymentCharge" MinWidth="110" Align="Right" EmptyCellText="--" />
<ext:NumberColumn runat="server" Text="One-Time Charges" Flex="1" DataIndex="OneTimeCharge" MinWidth="110" Align="Right" EmptyCellText="--" />
<ext:NumberColumn runat="server" Text="Reccuring Amount" Flex="1" DataIndex="RecurringCharge" MinWidth="110" Align="Right" EmptyCellText="--" />
<ext:Column runat="server" Text="End Date" Flex="1" DataIndex="EndDate" MinWidth="100" Align="Right" />
<ext:Column runat="server" Text="Effective Date" Flex="1" DataIndex="EffectiveDate" MinWidth="100" Align="Center" />
<ext:Column runat="server" Text="Level 1" Flex="1" DataIndex="Level1" MinWidth="180" />
<ext:Column runat="server" Text="Level 2" Flex="1" DataIndex="Level2" MinWidth="180" />
<ext:Column runat="server" Text="Level 3" Flex="1" DataIndex="Level3" MinWidth="180" />
<ext:Column runat="server" Text="Level 4" Flex="1" DataIndex="Level4" MinWidth="180" />
<ext:Column runat="server" Text="Level 5" Flex="1" DataIndex="Level5" MinWidth="180" />
<ext:Column runat="server" Text="Manufacturer" Flex="1" DataIndex="Manufacturer" MinWidth="180" />
<ext:Column runat="server" Text="Model" Flex="1" DataIndex="Model" MinWidth="100" />
<ext:Column runat="server" Text="Data" Flex="1" DataIndex="DataPackage" MinWidth="90" />
<ext:Column runat="server" Text="Storage" Flex="1" DataIndex="StoragePackage" MinWidth="80" />
<ext:Column runat="server" Text="Color" Flex="1" DataIndex="ColorPackage" MinWidth="80" />
</Columns>
</ColumnModel>
<Plugins>
<ext:RowEditing runat="server" ClicksToEdit="1" />
</Plugins>
</ext:GridPanel>
</Items>
</ext:Window><ext:Window
ID="winAddNewProductEntry" runat="server" Title="Add Products" Icon="ApplicationFormAdd" Height="500" Width="800" Hidden="true" ClientIDMode="Static"
BodyStyle="background-color: #fff;" BodyPadding="3" Modal="true" Layout="TableLayout">
<LayoutConfig>
<ext:TableLayoutConfig Columns="1" />
</LayoutConfig>
<Items>
<ext:Panel ID="pnSearchControls" runat="server" Title="Search Criteria">
<Content>
<table>
<tr>
<td>Keywords<br />
<ext:TextField ID="txtSearchProduct" runat="server" MinWidth="100" />
</td>
<td>Level 1<br />
<ext:ComboBox ID="cbLevel1" runat="server" Editable="false" Width="280px" QueryMode="Local" TriggerAction="All" EmptyText="Select Level 1" IDMode="Static">
<Listeners>
<Select Handler="#{cbLevel2}.clearValue(); #{stcbLevel2}.reload();" />
</Listeners>
</ext:ComboBox>
</td>
<td>Level 2<br />
<ext:ComboBox ID="cbLevel2" runat="server" Width="280px" TypeAhead="true" QueryMode="Local" ForceSelection="true" TriggerAction="All"
DisplayField="name" ValueField="id" EmptyText="Select Level 2" ValueNotFoundText="No Values" IDMode="Static" Enabled="false">
<Store>
<ext:Store runat="server" ID="stcbLevel2" AutoLoad="false" OnReadData="LevelsRefresh" IDMode="Static">
<Model>
<ext:Model runat="server" IDProperty="Id">
<Fields>
<ext:ModelField Name="id" Type="String" />
<ext:ModelField Name="name" Type="String" />
</Fields>
</ext:Model>
</Model>
<Parameters>
<ext:StoreParameter Name="Level" Value="2" Mode="Value" Action="read" />
</Parameters>
</ext:Store>
</Store>
<Listeners>
<Select Handler="#{cbLevel3}.clearValue(); #{stcbLevel3}.reload();" />
</Listeners>
</ext:ComboBox>
</td>
</tr>
<tr>
<td>Category<br />
<ext:ComboBox ID="cbProductTypes" runat="server" Editable="false" MinWidth="100" />
</td>
<td>Level 3<br />
<ext:ComboBox ID="cbLevel3" runat="server" Width="280px" TypeAhead="true" QueryMode="Local" ForceSelection="true" TriggerAction="All"
DisplayField="name" ValueField="id" EmptyText="Select Level 3" ValueNotFoundText="No Values" IDMode="Static" Enabled="false">
<Store>
<ext:Store runat="server" ID="stcbLevel3" AutoLoad="true" OnReadData="LevelsRefresh" IDMode="Static">
<Model>
<ext:Model runat="server" IDProperty="Id">
<Fields>
<ext:ModelField Name="id" Type="String" />
<ext:ModelField Name="name" Type="String" />
</Fields>
</ext:Model>
</Model>
<Parameters>
<ext:StoreParameter Name="Level" Value="3" Mode="Value" Action="read" />
</Parameters>
</ext:Store>
</Store>
<Listeners>
<Select Handler="#{cbLevel4}.clearValue(); #{stcbLevel4}.reload();" />
</Listeners>
</ext:ComboBox>
</td>
<td>Level 4<br />
<ext:ComboBox ID="cbLevel4" runat="server" Width="280px" TypeAhead="true" QueryMode="Local" ForceSelection="true" TriggerAction="All"
DisplayField="name" ValueField="id" EmptyText="Select Level 4" ValueNotFoundText="No Values" IDMode="Static" Enabled="false">
<Store>
<ext:Store runat="server" ID="stcbLevel4" AutoLoad="true" OnReadData="LevelsRefresh" IDMode="Static">
<Model>
<ext:Model runat="server" IDProperty="Id">
<Fields>
<ext:ModelField Name="id" Type="String" />
<ext:ModelField Name="name" Type="String" />
</Fields>
</ext:Model>
</Model>
<Parameters>
<ext:StoreParameter Name="Level" Value="4" Mode="Value" Action="read" />
</Parameters>
</ext:Store>
</Store>
<Listeners>
<Select Handler="#{cbLevel5}.clearValue(); #{stcbLevel5}.reload();" />
</Listeners>
</ext:ComboBox>
</td>
</tr>
<tr>
<td>
<ext:Button runat="server" Text="Search Products" Icon="Application">
<DirectEvents>
<Click OnEvent="AddRow_Click" />
</DirectEvents>
</ext:Button>
</td>
<td>Level 5<br />
<ext:ComboBox ID="cbLevel5" runat="server" Width="280px" TypeAhead="true" QueryMode="Local" ForceSelection="true" TriggerAction="All"
DisplayField="name" ValueField="id" EmptyText="Select Level 5" ValueNotFoundText="No Values" IDMode="Static" Enabled="false">
<Store>
<ext:Store runat="server" ID="stcbLevel5" AutoLoad="true" OnReadData="LevelsRefresh">
<Model>
<ext:Model runat="server" IDProperty="Id">
<Fields>
<ext:ModelField Name="id" Type="String" />
<ext:ModelField Name="name" Type="String" />
</Fields>
</ext:Model>
</Model>
<Parameters>
<ext:StoreParameter Name="Level" Value="5" Mode="Value" Action="read" />
</Parameters>
</ext:Store>
</Store>
</ext:ComboBox>
</td>
</tr>
</table>
</Content>
</ext:Panel>
<ext:GridPanel ID="gpCatProductEdit" runat="server" AutoScroll="true" Layout="VBoxLayout">
<LayoutConfig>
<ext:VBoxLayoutConfig Align ="StretchMax" />
</LayoutConfig>
<Store>
<ext:Store runat="server" AutoSync="false" ShowWarningOnFailure="true">
<Model>
<ext:Model runat="server" IDProperty="Id" Name="SelectedProductCatEntryItem" ClientIdProperty="Id" IDMode="Static">
<Fields>
<ext:ModelField Name="Id" Type="string" />
<ext:ModelField Name="Quantity" Type="Int" DefaultValue="1" />
<ext:ModelField Name="Duration" Type="Int" DefaultValue="1" />
<ext:ModelField Name="RequestTypeID" Type="Int" DefaultValue="1" />
<ext:ModelField Name="Category" Type="String" />
<ext:ModelField Name="Code" Type="String" />
<ext:ModelField Name="ProductIdName" Type="String" />
<ext:ModelField Name="PrepaymentCharge" Type="Float" />
<ext:ModelField Name="OneTimeCharge" Type="Float" />
<ext:ModelField Name="RecurringCharge" Type="Float" />
<ext:ModelField Name="EndDate" Type="String" />
<ext:ModelField Name="EffectiveDate" Type="String" />
<ext:ModelField Name="Level1" Type="String" />
<ext:ModelField Name="Level2" Type="String" />
<ext:ModelField Name="Level3" Type="String" />
<ext:ModelField Name="Level4" Type="String" />
<ext:ModelField Name="Level5" Type="String" />
<ext:ModelField Name="Manufacturer" Type="String" />
<ext:ModelField Name="Model" Type="String" />
<ext:ModelField Name="DataPackage" Type="String" />
<ext:ModelField Name="StoragePackage" Type="String" />
<ext:ModelField Name="ColorPackage" Type="String" />
</Fields>
</ext:Model>
</Model>
<Listeners>
<Exception Handler="
var error = operation.getError(),
message = Ext.isString(error) ? error : ('(' + error.status + ')' + error.statusText);
Ext.net.Notification.show({
iconCls : 'icon-exclamation',
html : message,
title : 'EXCEPTION',
autoScroll : true,
hideDelay : 5000,
width : 300,
height : 200
});" />
</Listeners>
</ext:Store>
</Store>
<ColumnModel>
<Columns>
<ext:Column runat="server" Flex="1" Text="Quantity" DataIndex="Quantity" MinWidth="70" Align="Center">
<Editor>
<ext:NumberField runat="server" MinValue="1" MaxValue="1000" />
</Editor>
</ext:Column>
<ext:Column runat="server" Flex="1" Text="Duration" DataIndex="Duration" MinWidth="80" Align="Center">
<Editor>
<ext:NumberField runat="server" AllowDecimals="false" MinValue="1" MaxValue="1000" />
</Editor>
</ext:Column>
<ext:Column runat="server" Text="Request Type" Flex="1" DataIndex="RequestTypeID" MinWidth="120">
<Renderer Fn="reqTypeRenderer" />
<Editor>
<ext:ComboBox runat="server" QueryMode="Local" Editable="false" StoreID="reqTypeStore" DisplayField="Name" ValueField="ID" />
</Editor>
</ext:Column>
<ext:Column runat="server" Text="Category" Flex="1" DataIndex="Category" MinWidth="70" />
<ext:Column runat="server" Text="Code" Flex="1" DataIndex="Code" MinWidth="130" />
<ext:Column runat="server" Text="Name" DataIndex="ProductIdName" MinWidth="250" />
<ext:NumberColumn runat="server" Text="Total First Month" Flex="1" DataIndex="PrepaymentCharge" MinWidth="110" Align="Right" EmptyCellText="--" />
<ext:NumberColumn runat="server" Text="One-Time Charges" Flex="1" DataIndex="OneTimeCharge" MinWidth="110" Align="Right" EmptyCellText="--" />
<ext:NumberColumn runat="server" Text="Reccuring Amount" Flex="1" DataIndex="RecurringCharge" MinWidth="110" Align="Right" EmptyCellText="--" />
<ext:Column runat="server" Text="End Date" Flex="1" DataIndex="EndDate" MinWidth="100" Align="Right" />
<ext:Column runat="server" Text="Effective Date" Flex="1" DataIndex="EffectiveDate" MinWidth="100" Align="Center" />
<ext:Column runat="server" Text="Level 1" Flex="1" DataIndex="Level1" MinWidth="180" />
<ext:Column runat="server" Text="Level 2" Flex="1" DataIndex="Level2" MinWidth="180" />
<ext:Column runat="server" Text="Level 3" Flex="1" DataIndex="Level3" MinWidth="180" />
<ext:Column runat="server" Text="Level 4" Flex="1" DataIndex="Level4" MinWidth="180" />
<ext:Column runat="server" Text="Level 5" Flex="1" DataIndex="Level5" MinWidth="180" />
<ext:Column runat="server" Text="Manufacturer" Flex="1" DataIndex="Manufacturer" MinWidth="180" />
<ext:Column runat="server" Text="Model" Flex="1" DataIndex="Model" MinWidth="100" />
<ext:Column runat="server" Text="Data" Flex="1" DataIndex="DataPackage" MinWidth="90" />
<ext:Column runat="server" Text="Storage" Flex="1" DataIndex="StoragePackage" MinWidth="80" />
<ext:Column runat="server" Text="Color" Flex="1" DataIndex="ColorPackage" MinWidth="80" />
</Columns>
</ColumnModel>
<Plugins>
<ext:RowEditing runat="server" ClicksToEdit="1" />
</Plugins>
</ext:GridPanel>
</Items>
</ext:Window>
Last edited by Daniil; Aug 20, 2014 at 4:31 AM.
Reason: [CLOSED]