Hi,
I have a window displaying a list of checkboxes with “ok” and “reset” button as dockeditems:
Code:
var window = Ext.create('mypage.newWindow', {
title: button.parentId.id,
dockedItems: [{
xtype: 'toolbar',
dock: 'bottom',
items:[{
xtype:'button',
text:'OK',
listeners:{
'click':this.handleWindowOk,
scope:this
}
},{
xtype:'button',
text:'RESET',
listeners:{
'click':this.handleWindowReset,
scope:this
}
}]
}],
items:[
{
xtype: 'fieldcontainer',
items:WindowItems
}]
}).show();
In the event listeners of “handleWindowOk” I want to catch the “checked” items and close the window but I was not able to get a reference to the window container.
I tried the following approaches :
Code:
handleWindowOk:function(button){
// Approach#1
//console.log(this.getNewWindow());
// Approach#2
var ParentWindow = button.findParentBy(function(container, component) {
return (container.xtype === 'mypage.newWindow');
});
console.log(ParentWindow);
//Approach#3
//console.log(button.findParentByType('mypage.newWindow'));
//Approach#4
//console.log(button.up('Ext.window.Window'));
//Approach#5
//console.log(button.up('window[xtype = mypage.newWindow]'));
//Approach#6
//console.log(button.up(Ext.window.Window));
//Approach#7
console.log(button.up('mypage.newWindow'));
}
All the approaches are giving null result.
The window is not a child nor a sub item of any container.