Apr 04, 2014, 3:01 AM
[CLOSED] Reload Parent TabPanel after closing child window
I have a tabpanel with gridpanel, the gridpanel has a commandcolumn which call a child window. I'd like it after that child window closes (using function from the child's codebehind), the parent's tabpanel reloads. there's a function to reload the tabpanel on the parent's codebehind. My question is, how to call a function on the parent's codebehind from the child window's codebehind.
here is my code
parentform.aspx
childform.aspx codebehind
here is my code
parentform.aspx
<ext:TabPanel ID="TabPanel1" runat="server">
<Items>
<ext:Panel ID="TabPrcs" runat="server" Title="Process">
<Items>
<ext:FormPanel
ID="FormPrcs"
runat="server"
Title=""
BodyStyle="background-color: #DFE8F6"
BodyPadding="10"
Margins="0 5 0 5"
Frame="true"
Split="true">
<Items>
<ext:GridPanel
ID="GridPrcs"
runat="server"
>
<Store>
<ext:Store ID="storePrcsDoc" runat="server">
<Model>
<ext:Model runat="server" ID="Model5">
<Fields>
<ext:ModelField Name="VendorName" Type="String" />
<ext:ModelField Name="ReqDate" Type="String" />
<ext:ModelField Name="DocDate" Type="String" />
<ext:ModelField Name="ExpDate" Type="String" />
<ext:ModelField Name="CloseStatus" Type="String" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel ID="ColumnPrcs" runat="server">
<Columns>
<ext:Column ID="Column32" runat="server" Text="Name" DataIndex="Name" flex="1">
</ext:Column>
<ext:Column ID="Column33" runat="server" Text="Date" DataIndex="Date" width="100">
<Renderer Format="Date" FormatArgs="'d-M-Y'" />
</ext:Column>
<ext:CommandColumn ID="btnDetaildocsPrcs" runat="server" Width="58">
<Commands>
<ext:GridCommand Icon="NoteEdit" CommandName="Detail" StandOut="true" Text="Detail">
<ToolTip Text="View Detail" />
</ext:GridCommand>
</Commands>
<DirectEvents>
<Command OnEvent="DetailDocsPrcs_click">
<ExtraParams >
<ext:Parameter Name="record" value="Ext.encode(#{GridPrcs}.getRowsValues({selectedOnly:true}))" Mode="Raw" Encode="true" />
</ExtraParams>
</Command>
</DirectEvents>
</ext:CommandColumn>
</Columns>
</ColumnModel>
<View>
<ext:GridView runat="server" StripeRows="true" TrackOver="true" />
</View>
</ext:GridPanel>
<ext:ToolTip
runat="server"
Target="={#{GridPrcs}.getView().el}"
Delegate=".x-grid-cell"
TrackMouse="true">
<Listeners>
<Show Handler="onShow(this, #{GridPrcs});" />
</Listeners>
</ext:ToolTip>
</Items>
</ext:FormPanel>
</Items>
</ext:Panel>
</Items>
</ext:TabPanel>
parentform.aspx codebehindPublic Sub DetailDocsPrcs_click(ByVal sender As Object, ByVal e As EventArgs)
If X.IsAjaxRequest Then
Dim win As New Window
Try
With win
.Title = "Document"
.Width = Unit.Pixel(950)
.Height = Unit.Pixel(500)
.Modal = False
.Collapsible = True
.Maximizable = True
.Loader = New ComponentLoader With
{
.Url = "../childform.aspx,
.Mode = LoadMode.Frame,
.AutoLoad = True
}
.Render(Me.Form)
.Show()
End With
Catch ex As Exception
ErrHandler(ex, btnDetaildocsPrcs)
End Try
End If
End Sub
childform.aspx<td Width="100">
<ext:Button ID="SubmitButton" runat="server" Text="Execute" ToolTip="Submit" Width="100" align= "right">
<DirectEvents>
<Click OnEvent="SubmitButton_Click">
<EventMask ShowMask="true" Msg="Processing..." MinDelay="10"/>
<ExtraParams>
<ext:Parameter Name="Items" Value="Ext.encode(#{GridItems}.getRowsValues({selectedOn:true}))" Mode="Raw" />
</ExtraParams>
</Click>
</DirectEvents>
</ext:Button>
</td>
I need to call the function loadtabpanel() on parent codebehind to reload the parent tabpanel after the child closes.childform.aspx codebehind
Public Sub SubmitButton_Click(ByVal sender As Object, ByVal e As DirectEventArgs) Handles SubmitButton.Click
If X.IsAjaxRequest Then
X.Js.AddScript("parentAutoLoadControl.hide();")
parent.loadtabpanel()
End If
End Sub
Last edited by Daniil; Apr 09, 2014 at 1:43 AM.
Reason: [CLOSED]