Results 1 to 2 of 2

Thread: Not able to access the window which i created in controller file itself.

  1. #1
    Sencha User Prasad_Guduri's Avatar
    Join Date
    Feb 2014
    Posts
    16
    Answers
    2

    Default Answered: Not able to access the window which i created in controller file itself.

    Hi All,

    In controller file, for button click i created window with two panels.

    When i clcik on the cancel button[cancel button is inside the window, in first panel] i want to hide the window.

    onClickCertifyBurron(){
    var window = _craeteWinodw();
    window.show();
    }

    _createWindow: function ()
    {
    return new Ext.window.Window(
    {
    itemId:'certificationWindow',
    modal: true,
    shadow: false,
    layout: 'fit',
    hideMode: 'offsets',
    closeAction: 'hide',
    loadMask: true,
    constrain: true,
    cls: 'rp_modal',
    bodyStyle: 'background-color:#F0F0F0;',
    resizable: false,
    border: true,
    title: ' ',
    width: 620,
    height: 460,
    scope: this
    });
    },


    Refs i declares as following:

    { // certificationWIndow
    ref: 'certificationWIndow',
    selector: 'timecard #certificationWindow'
    }

    oncancelButtonClick: function(){
    // here i want to access the window to close. but showing as undefined.
    }

    Thanks & Regards,
    Prasad Guduri

  2. The button is passed as an argument and you can then use ComponentQuery to get the window reference:

    Code:
    oncancelButtonClick : function(button) {
       var win = button.up('window');
    
        win.close();
    }

  3. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379
    Answers
    3997

    Default

    The button is passed as an argument and you can then use ComponentQuery to get the window reference:

    Code:
    oncancelButtonClick : function(button) {
       var win = button.up('window');
    
        win.close();
    }
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

Tags for this Thread

Posting Permissions

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