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

  1. #1

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

    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?

    regards,
    Last edited by geoffrey.mcgill; Feb 15, 2012 at 5:16 PM. Reason: [CLOSED], please use [CODE] tags
  2. #2
    Hello,

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

    Example

    parent.LocateRecord();
    Hope this helps.
    Geoffrey McGill
    Founder
  3. #3

    The child window (search window) opens only inside the parent window (entry form window).

    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?

    regards
  4. #4
    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.
    Geoffrey McGill
    Founder
  5. #5
    thank's

    When it releases version 2.0 of extnet ?
  6. #6
    The Ext.NET v2 beta release is imminent.
  7. #7
    thank's.

    no more questions


    regards

Similar Threads

  1. Replies: 7
    Last Post: Feb 09, 2012, 12:17 PM
  2. [CLOSED] call parent js function from client window
    By majestic in forum 1.x Legacy Premium Help
    Replies: 8
    Last Post: Oct 29, 2010, 10:21 AM
  3. [CLOSED] [1.0] Call to grid function from child window
    By edigital in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Sep 16, 2010, 9:41 AM
  4. [CLOSED] call function from child window
    By speedstepmem4 in forum 1.x Legacy Premium Help
    Replies: 11
    Last Post: Apr 29, 2009, 4:31 PM
  5. Replies: 1
    Last Post: Apr 01, 2009, 1:24 PM

Posting Permissions