Jun 06, 2014, 3:05 AM
[CLOSED] How to pass parameter from row expander grid that's created dynamically
Hello,
I have multiple level of grids using row expander created dynamically from code behind. Those gridpanel and Store are created in loops, so that their ID are created dynamically. How to passing parameter using button in order to save all the grids to database?
In normal case, I pass the parameter as follows,
The Button:
I have multiple level of grids using row expander created dynamically from code behind. Those gridpanel and Store are created in loops, so that their ID are created dynamically. How to passing parameter using button in order to save all the grids to database?
In normal case, I pass the parameter as follows,
The Button:
<ext:Button ID="SaveButton" runat="server" Text="Save" ToolTip="Save File" Width="100" align= "right" Name="SaveButton" icon="accept">
<DirectEvents>
<Click OnEvent="SaveButton_Click">
<EventMask ShowMask="true" Msg="Processing..."/>
<ExtraParams>
<ext:Parameter
Name="Items" Value="Ext.encode(#{GridItems}.getRowsValues({selectedOn:true}))" Mode="Raw" />
</ExtraParams>
</Click>
</DirectEvents>
</ext:Button>
The Grid: <ext:FormPanel
ID="FormItems"
runat="server"
Title=""
BodyStyle="background-color: #DFE8F6"
BodyPadding="10"
Margins="0 5 0 5"
Height="150"
Frame="true"
Split="true">
<TopBar>
<ext:Toolbar ID="ToolbarItems" runat="server">
<Items>
<ext:Button ID="btnAddItems" runat="server" Text="Add Item/s" Icon="Add" OnClientClick="insertItems()">
</ext:Button>
<ext:ToolbarSeparator />
<ext:Button ID="btnDelItems" runat="server" Text="Delete" Icon="Exclamation">
<Listeners>
<Click Handler="#{GridItems}.deleteSelected(); #{UserForm}.getForm().reset();" />
</Listeners>
</ext:Button>
</Items>
</ext:Toolbar>
</TopBar>
<Items>
<ext:GridPanel
ID="GridItems"
runat="server"
fitToFrame="true"
Anchor="100% 100%">
<Store>
<ext:Store ID="STRDocItems" runat="server">
<Model>
<ext:Model runat="server" ID="ModelItems">
<Fields>
<ext:ModelField Name="Item" Type="String" />
<ext:ModelField Name="Text" Type="String" />
<ext:ModelField Name="Qty" Type="String" />
<ext:ModelField Name="UoM" Type="String" />
<ext:ModelField Name="PrcStg" Type="String" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel ID="ColumnItems" runat="server">
<Columns>
<ext:Column ID="Column1" runat="server" Text="NO" DataIndex="Item" width="25" Enabled="false"/>
<ext:Column ID="Column2" runat="server" Text="Text" DataIndex="Text" width="200">
<Editor>
<ext:TextField ID="edText" runat="server"/>
</Editor>
</ext:Column>
<ext:Column ID="Column3" runat="server" Text="Qty" DataIndex="Qty" width="35">
<Editor>
<ext:TextField ID="edQty" runat="server" />
</Editor>
<Renderer Fn="Ext.util.Format.numberRenderer('0.0,0')" />
</ext:Column>
<ext:Column ID="Column4" runat="server" Text="UoM" DataIndex="UoM" width="55">
<Editor>
<ext:ComboBox
ID="UoMDropDownItems"
runat="server"
DisplayField="state"
ValueField="abbr"
EmptyText="Select UoM...">
<Store>
<ext:Store ID="STRUoMDropDownItems" runat="server">
<Model>
<ext:Model ID="ModelUoMDropDownItems" runat="server">
<Fields>
<ext:ModelField Name="TableDesc" />
<ext:ModelField Name="TableCode" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
</ext:ComboBox>
</Editor>
</ext:Column>
<ext:Column ID="Column5" runat="server" Text="Price Strategy" DataIndex="PrcStg" width="80">
<Editor>
<ext:ComboBox
ID="PrcStgDropDownItems"
runat="server"
DisplayField="state"
ValueField="abbr"
EmptyText="Select Price Strategy..."
>
<Store>
<ext:Store ID="STRPrcStgDropDownItems" runat="server">
<Model>
<ext:Model ID="ModelPrcStgDropDownItems" runat="server">
<Fields>
<ext:ModelField Name="StgID" />
<ext:ModelField Name="Description" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ListConfig Height="300" ItemSelector=".x-boundlist-item">
<Tpl runat="server">
<Html>
<tpl for=".">
<tpl if="[xindex] == 1">
<table class="cbStates-list" width="400">
<tr>
<th> Code </th>
<th>Description</th>
</tr>
</tpl>
<tr class="x-boundlist-item">
<td>{StgID}</td>
<td>{Description}</td>
</tr>
<tpl if="[xcount-xindex]==0">
</table>
</tpl>
</tpl>
</Html>
</Tpl>
</ListConfig>
</ext:ComboBox>
</Editor>
</ext:Column>
</Columns>
</ColumnModel>
<Plugins>
<ext:CellEditing runat="server" ClicksToEdit="1" />
</Plugins>
</ext:GridPanel>
</Items>
</ext:FormPanel>
Last edited by Daniil; Jun 12, 2014 at 4:17 AM.
Reason: [CLOSED]