PDA

View Full Version : Not able to access the window which i created in controller file itself.



Prasad_Guduri
3 Feb 2014, 10:56 AM
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

mitchellsimoens
6 Feb 2014, 1:05 PM
The button is passed as an argument and you can then use ComponentQuery to get the window reference:


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

win.close();
}