Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
700 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 Reply

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...