Reputation: 115
I tried to close parent window in extjs with this.up().close()
, but this.$className is undefined.
I am looking for a solution without using Ext.getCmp.
https://fiddle.sencha.com/#view/editor&fiddle/3b4i
Upvotes: 1
Views: 210
Reputation: 4706
Not sure what you want to hide, anyway:
Ext.application({
name: 'Fiddle',
launch: function () {
Ext.create('Ext.Container', {
renderTo: Ext.getBody(),
items: [{
xtype: 'panel',
title: 'my Panel',
html: "Some text.",
width: 350
}, {
xtype: 'box',
html: '<a href="#" class="link-forgot-password"> Close window</a>',
listeners: {
render: function () {
this.getEl().on('click', function () {
//this.up('container').hide(); // Hide wrapper container
this.previousSibling().hide(); // Hide previous Panel
}, this);
}
}
}]
});
}
});
Upvotes: 1
Reputation: 702
Your scope is wrong. You give your element the scope of the application which is the reason why this.up() won't work. If you remove scope: this
you should be able to use this.up()
to get the parent container.
I made a fork of your sencha fiddle with a working example: Sencha fiddle example
Upvotes: 4