Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
698 views
in Technique[技术] by (71.8m points)

button - How to close parent container in extjs

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

question from:https://stackoverflow.com/questions/65621697/how-to-close-parent-container-in-extjs

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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);
                    }
                }
            }]
        });
    }
});

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...