View Full Version : [CLOSED] We are trying to call a javascript function in a parent window after this one opens a new child window.

Feb 14, 2012, 7:35 PM
We use ExtNet with Asp.Net MVC and we are trying to accomplish something that is really easy using regular javascript functions but we are not clear about how to do that using the ExtNet window.
We are trying to call a javascript function in a parent window after this one opens a new child window.

in the parent one we have a button:

<ext:Button ID="btnProcurar" runat="server" AutoWidth="false" Width="80px" Text="Search"
Icon="Find" StyleSpec="padding-top:2px;" OnClientClick="openWindow();" />

... and a function...

var openSearchWindow = function () {
// some code
var searchWindow = new Ext.IframeWindow({
id: 'searchWindow',
title: Search Lookup',
layout: 'fit',
autoScroll: true,
height: altura,
width: largura,
collapsible: true,
maximizable: true,
minimizable: true,
closeAction: "close",
icon: "Application",
modal: true,
dialog: true,
prompt : true,
src: '/one_url/',
MaskMsg: 'Loading...',
ShowMask: true

// some code

.. and another function...

var LocateRecord = function () {


the child one opens and now we need to call the "LocateRecord" function written in the parent.

In regular windows created with the usual "window.open" javascript function I just can access the function calling window.opener.LocateRecord()

How can I do the same with ExtNet?


Feb 14, 2012, 8:02 PM

From the child, you should be able to call parent.LocateRecord();



Hope this helps.

Feb 14, 2012, 9:22 PM
Thank you very much. It works now!

But now we have another problem.
The child window (search window) opens only inside the parent window (entry form window).

Our window hierarchy is: main window > entry form window > search window

The search window opens inside the entry form window, which is not so great because the search window is usually bigger than the entry form window.

So, we would like to open this window as a child of the main window. How can we do that?


Feb 14, 2012, 10:27 PM
For this to work, ideally the Window object needs to be instantiated and rendered to the parent frame. Components rendered to a child frame will be trapped inside that child frame.

Feb 15, 2012, 11:51 AM

When it releases version 2.0 of extnet ?

Feb 15, 2012, 12:21 PM
The Ext.NET v2 beta release is imminent.

Feb 15, 2012, 4:15 PM

no more questions