PDA

View Full Version : [CLOSED] Access parent panel attribute from iframe



bayoglu
May 08, 2013, 2:26 PM
Hi,

I am dynamically creating a panel and loading another aspx into it's content as iFrame.

Sth. like this:



MyPanel = new Ext.Net.Panel();
MyPanel.ID = "MyPanel";
MyPanel.CustomConfig.Add(new ConfigItem { Name = "refreshMe", Mode = ParameterMode.Raw, Value = "true", Encode = false });
MyPanel.Loader = new ComponentLoader
{
Url = "/MyChild.aspx",
Mode = LoadMode.Frame,
LoadMask =
{
ShowMask = true,
Msg = "Loading..."
}
};


I want to access MyPanel.refreshMe custom config from the iFrame aspx page. For this, I met this (http://forums.ext.net/showthread.php?427) threat and tried using parent.window call. When I get MyPanel like this : "parent.window.MyPanel" it is not the Ext.Panel object and I have no access to MyPanel.refreshMe.

How can I access custom config of an iFrame content's parent panel? Is it possible at all?

Thanks.

bayoglu
May 08, 2013, 2:41 PM
Okay, I found parent.App (;

bayoglu
May 08, 2013, 2:59 PM
Bad news,

parent.App is okay but in real scenario MyPanel ID is dynamic so I can not get it easily as "parent.App.MyPanel".

I tried following but none return the Ext.Panel object.

parent.Ext.get("Dynamic_ID")
parent.document.getElementById("Dynamic_ID")

What is the correct way of accessing an object given text ID?

Thanks.

bayoglu
May 08, 2013, 3:02 PM
Me again (;

I could access it with parent.Ext.getCmp("Dynamic_ID").
Please mark as closed.

Daniil
May 08, 2013, 3:20 PM
This also should work.

parent.App["Dynamic_ID"]

bayoglu
May 09, 2013, 3:09 AM
Cool. Thanks Daniil.