View Full Version : [CLOSED] how to hand over child window's data to the parents sheet's field

Jan 15, 2015, 10:54 PM
Dear all,
I can't solve the problem how to hand over child window's row data to the parents sheet's field.
Below, there are two sample source.
One is parents sheet, and another is child modal window made by GridPanel.
In the example, child window's row-selected data(deptcd) gridpanel hand over when that row data is double-clicked or row-command icon clicked.
So, I need two solution :
1. how to hand over when child selected-row is double-clicked.
2. how to hand over when child row-command icon is clicked.

[Parents Page Code]

<script runat="server">
protected void DeptCodeHelper(object sender, DirectEventArgs e)
UserControlRendererConfig config = new UserControlRendererConfig
UserControlPath = "DeptCodeHelper.ascx",
SingleControl = true,
Mode = RenderMode.RenderTo,
Element = this.Form.ClientID

config.BeforeRender += delegate(ComponentAddedEventArgs ce)
ce.Control.ID = BaseControl.GenerateID();
e.ExtraParamsResponse.Add(new Ext.Net.Parameter("windowId", ce.Control.ConfigID));


<ext:ResourceManager ID="ResourceManager1" runat="server" DirectMethodNamespace="CompanyX"/>

<ext:FormPanel ID="FormPanel1" runat="server" title="Department" Frame="true" Width="400" ButtonAlign="left" >
<FieldDefaults LabelAlign="Left" LabelWidth="100" />
<ext:FieldContainer ID="FieldContainer1" runat="server" Layout="HBoxLayout">
<ext:TextField ID="ctlDeptNm" runat="server" FieldLabel="DeptCode" AllowBlank="True"/>
<ext:Button ID="Button2" runat="server" Icon="Magnifier">
<Click OnEvent="DeptCodeHelper" Single="true" />
<ext:Container ID="Container1" runat="server">
<ext:TextField ID="ctlDeptCd" runat="server" FieldLabel="DeptCode" AllowBlank="false" />

[Child Window Code]

<ext:Window ID="Window1" runat="server" Title="CodeHelper" Width="400" Height="400"
MinWidth="300" MinHeight="300" Layout="FitLayout" Resizable="true" Modal="true">
<ext:FormPanel ID="FormPanel2" runat="server" Border="false" AutoDoLayout="true" BodyPadding="10">
<ext:GridPanel ID="GridPanel2" runat="server" Width="370" Height="310">
<ext:Store ID="Store2" runat="server">
<ext:Model ID="Model2" runat="server">
<ext:ModelField Name="DeptCd" Type="String"/>

<ext:Column ID="Column1" runat="server" Text="DeptCode" DataIndex="DeptCd" Width="60" />
<ext:CommandColumn ID="CommandColumn2" runat="server" Width="20">
<ext:GridCommand Icon="Add" CommandName="Detail" />
<Command OnEvent="btnSelect">
<ext:Parameter Name="cmd" Value="command" Mode="Raw" />
<ext:Parameter Name="data" Value="record.data.DeptCd" Mode="Raw" />

<ext:RowSelectionModel ID="RowSelectionModel2" runat="server" >

Jan 16, 2015, 6:41 AM
Hi @rockhome,

1. how to hand over when child selected-row is double-clicked.

There is a ItemDblClick even on a GridPanel. Probably, you could try to use it.

2. how to hand over when child row-command icon is clicked.

You already set up a Command DirectEvent on the CommandColumn. Does it not work as you need? I guess it doesn't, because a DirectEvent should not be working in such a scenario. You render the User Control control dynamically. If you don't recreate that User control on each request, then DirectEvents cannot work. Any DirectEvent requires a control instance on server.

I think you could use a client side Listener and do everything in JavaScript.