PDA

View Full Version : [CLOSED] Help : How Changing Treepanel after update in the IFrame (Server Side)



yuda236
Jun 10, 2014, 2:08 AM
I Have Problem About Change Node Text in Treepanel After I do Action in Other Page(IFrame)

this My Source Code

Iframe.aspx


<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Iframe.aspx.cs" Inherits="WEB.HeaderTesting" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<%@ Import Namespace="Ext.Net.Utilities" %>
<%@ Import Namespace="System.Collections.Generic" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>IFrame</title>
<script type="text/javascript">
var addTab = function (tabPanel, record) {
var text = record.data.viewheader,
tab = tabPanel.getComponent(text);
if (record.data.url != "") {
if (!tab) {
tab = tabPanel.add({
id: text,
title: text,
closable: true,
loader: {
url: record.data.url,
renderer: "frame",
loadMask: {
showMask: true,
msg: "Loading " + text + "..."
}
}
});
}
tabPanel.setActiveTab(tab);
}
};

var showWindow = function (window) {
window.show();
}

var addTabLaporan = function (window, tabPanel, id, url, title) {
window.hide();
addTab(tabPanel, id, url, title);
}


</script>
</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<ext:Viewport ID="Viewport1" runat="server" Layout="border">
<Items>

<ext:Panel
ID="Panel2"
runat="server"
AnimCollapse="true"
Border="false"
Title="Module Navigation"
Region="West"
Layout="accordion"
Width="225"
MinWidth="150"
MaxWidth="400"
Split="true"
Collapsible="true"
Header="false" >
<Items>

<ext:TreePanel ID="TreePanel23"
runat="server"
Title="Navigation Menu"
Closable="false"
Icon = "Neighbourhood"
AutoScroll="true"
CollapseFirst="false"
RootVisible="false">
<Fields>
<ext:ModelField Name="url" />
<ext:ModelField Name="viewheader" />

</Fields>
<Root>
<ext:Node NodeID="headerID">
<Children>
<ext:Node NodeID="DetailID" Text="Detail (Click Here)">
<CustomConfig>
<ext:ConfigItem Name="url" Value="Detail.aspx" />
<ext:ConfigItem Name="viewheader" Value="Detail" />
</CustomConfig>
</ext:Node>
</Children>
</ext:Node>
</Root>

<BottomBar>
<ext:StatusBar ID="StatusBar23" runat="server" AutoClear="1500" />
</BottomBar>
<Listeners>
<ItemClick Handler="addTab(App.TabPanel1, record);" />
</Listeners>
</ext:TreePanel>



</Items>
</ext:Panel>


<ext:TabPanel ID="TabPanel1" runat="server" Region="Center" Margins="0 4 4 0" AutoScroll="true">
<Items>
</Items>
</ext:TabPanel>
</Items>
</ext:Viewport>

</form>
</body>
</html>


Detail.aspx


<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Detail.aspx.cs" Inherits="WEB.Testing" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<%@ Import Namespace="Ext.Net.Utilities" %>
<%@ Import Namespace="System.Collections.Generic" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<ext:ResourceManager runat="server" />
<ext:Panel runat="server" ID="Panel2" Title="Panel2" BodyStyle="padding: 2px 2px 2px 2px" Border="false" BodyBorder="0" AutoScroll="true" MinHeight="200">
<Items>
<ext:HtmlEditor ID="HtmlEditor1" runat="server" Height="200" Width="650" FieldLabel="HtmlEditor1"
LabelWidth="120" />
</Items>
</ext:Panel>

<ext:Button runat="server" ID="ClickHere" Text = "Click Here">
<DirectEvents>
<Click OnEvent="ClickHere_Click" />
</DirectEvents>
</ext:Button>
</div>
</form>
</body>
</html>



I Want Change Node Text


<ext:Node NodeID="DetailID" Text="Detail (Click Here)">
<CustomConfig>
<ext:ConfigItem Name="url" Value="Detail.aspx" />
<ext:ConfigItem Name="viewheader" Value="Detail" />
</CustomConfig>
</ext:Node>


with Other Text

after I Click


<Click OnEvent="ClickHere_Click" />


How Method For Solve This Problemhttp://forums.ext.net/attachment.php?attachmentid=12371&stc=1 ?

Thanks

Daniil
Jun 10, 2014, 5:52 AM
Hi @yuda236,

You cannot access a parent page from its iframe's code behind, but you can do that in JavaScript.

To get access to a TreePanel (on the parent page) in a Button's Click listener (on the child page), please use:

parent.App.TreePanelID