Results 1 to 7 of 7

Thread: Regarding closing a parent popup on close of child popup..

  1. #1

    Default Regarding closing a parent popup on close of child popup..

    My current situation is that i've a popup opened from the main page..and from that popup i've another popup opened..so on close of the child popup , i want the parent popup to be closed..also..on open of the parent popup i want the remaining page to be grey or disabled..
    i'm sorry but i'm new tto js and ext js..hence the doubt..

  2. #2
    Sencha User
    Join Date
    Mar 2016
    Posts
    44
    Answers
    2

    Default

    Quote Originally Posted by Mariya Baby View Post
    My current situation is that i've a popup opened from the main page..and from that popup i've another popup opened..so on close of the child popup , i want the parent popup to be closed..also..on open of the parent popup i want the remaining page to be grey or disabled..
    i'm sorry but i'm new tto js and ext js..hence the doubt..
    add modal:true for parrent popup
    When you will open child popup add to config reference on parent popup. Also you can do it via query but I think reference will be simplest.

  3. #3

    Default

    "When you will open child popup add to config reference on parent popup "..what did you mean by this? can you tell it with an example..
    this is my code..this issn't working..


    Ext.define('parent.popup', {
    extend: 'Ext.window.Window,
    text: _translate("Add"),
    iconCls: 'add',
    modal : true,
    handler: function() {

    console.log("Pressed Add button");
    var window = Ext.create('child.popup', {

    });
    window.show();

    }
    })

  4. #4
    Sencha User
    Join Date
    Mar 2016
    Posts
    44
    Answers
    2

    Default

    Quote Originally Posted by Mariya Baby View Post
    "When you will open child popup add to config reference on parent popup "..what did you mean by this? can you tell it with an example..
    this is my code..this issn't working..


    Ext.define('parent.popup', {
    extend: 'Ext.window.Window,
    text: _translate("Add"),
    iconCls: 'add',
    modal : true,
    handler: function() {

    console.log("Pressed Add button");
    var window = Ext.create('child.popup', {

    });
    window.show();

    }
    })

    Code:
    
    Ext.define('parent.popup', {
        extend: 'Ext.window.Window,
        text: _translate("Add"),
        iconCls: 'add',
        modal : true,
        handler: function(parent) {
        
                console.log("Pressed Add button");
                var window = Ext.create('child.popup', {
                         parentRef: parent,
        listeners:{
       // on close use reference parentRef to close parent
         }
                });
                window.show();
                
            } 
        })

  5. #5

    Default

    still not working..ReferenceError: parentRef is not defined it's giving the above error..

    my child popup is in another js file which is put in the requires option of the parent js..

  6. #6
    Sencha User
    Join Date
    Mar 2016
    Posts
    44
    Answers
    2

    Default

    Quote Originally Posted by Mariya Baby View Post
    still not working..ReferenceError: parentRef is not defined it's giving the above error..

    my child popup is in another js file which is put in the requires option of the parent js..

    Maria, please see following link: https://fiddle.sencha.com/#view/editor&fiddle/222p

  7. #7

    Default

    Hi @NoOnesThere89, thank you so much for the info. This code helped me a lot.. I have one more doubt..should i post it here or post as another thread?

Similar Threads

  1. Closing a Modal Popup when user Clicks Outside
    By dmoore1 in forum Ext 5: Q&A
    Replies: 2
    Last Post: 9 Jul 2015, 12:49 PM
  2. can't close popup
    By vivendi in forum Sencha Touch 2.x: Q&A
    Replies: 2
    Last Post: 15 Mar 2012, 12:02 AM
  3. Replies: 4
    Last Post: 6 Oct 2011, 11:29 AM
  4. Closing a popup window
    By dana.lees in forum Ext 3.x: Help & Discussion
    Replies: 12
    Last Post: 15 Oct 2009, 2:24 AM
  5. Replies: 1
    Last Post: 13 Aug 2008, 11:01 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •