Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Button 如何关闭extjs中的父容器_Button_Extjs - Fatal编程技术网

Button 如何关闭extjs中的父容器

Button 如何关闭extjs中的父容器,button,extjs,Button,Extjs,我试图用this.up.close关闭extjs中的父窗口,但未定义此.$className。 我正在寻找一个不使用Ext.getCmp的解决方案 你的范围错了。您为元素提供了应用程序的范围,这就是此.up无法工作的原因。如果删除作用域:这应该可以使用this.up获取父容器 我用你的sencha小提琴做了个叉子 您的范围是错误的。您为元素提供了应用程序的范围,这就是此.up无法工作的原因。如果删除作用域:这应该可以使用this.up获取父容器 我用你的sencha小提琴做了个叉子 无论如何,不

我试图用this.up.close关闭extjs中的父窗口,但未定义此.$className。 我正在寻找一个不使用Ext.getCmp的解决方案


你的范围错了。您为元素提供了应用程序的范围,这就是此.up无法工作的原因。如果删除作用域:这应该可以使用this.up获取父容器

我用你的sencha小提琴做了个叉子
您的范围是错误的。您为元素提供了应用程序的范围,这就是此.up无法工作的原因。如果删除作用域:这应该可以使用this.up获取父容器

我用你的sencha小提琴做了个叉子

无论如何,不确定要隐藏什么:

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

无论如何,不确定要隐藏什么:

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