Extjs 6.0.2:setStyle为null

时间:2017-01-17 12:08:46

标签: javascript extjs extjs6 extjs6-classic

我是在另一个面板A内创建浮动面板B(渲染到A); 当我关闭面板A时,面板B也会关闭。但是小组B仍然在zIndexManager.zIndexStack。因此,调用该组件以更改其z并因此给出setStyle null错误。有什么想法吗?

var A = Ext.create('Ext.form.Panel', {
            floating: true,
            alignOnScroll: false,
            resizable: false,
            layout: 'fit',
            width: 450,
            height: 400,
            renderTo: B.id,
            items: [another Panel],
            dockedItems: [{
                xtype: 'toolbar',
                style: 'background:#f6f6f6',
                dock: 'bottom',
                layout: {
                    pack: 'center',
                    type: 'hbox'
                },
                items: [{
                        xtype: 'button',
                        ui: 'header',
                        tooltip: 'Submit',
                        iconCls: 'x-fa fa-check',
                        scope: this

                    },
                    {
                        xtype: 'button',
                        ui: 'header',
                        tooltip: 'Close',
                        iconCls: 'x-fa fa-remove',
                        scope: this,
                    }
                ]
            }]
        });

        A.showBy(this.lookupReference('abcd'), 'tl-tr?');

关闭父面板并重新打开后,我得到以下错误

  

未捕获的TypeError:无法读取属性' style'为null       在constructor.setStyle(ext-all-rtl-debug.js?_dc = 20170112151748:37862)       在constructor.setZIndex(ext-all-rtl-debug.js?_dc = 20170112151748:38103)       在constructor.setZIndex(ext-all-rtl-debug.js?_dc = 20170112151748:59257)       在constructor.onCollectionSort(ext-all-rtl-debug.js?_dc = 20170112151748:124552)       在constructor.notify(ext-all-rtl-debug.js?_dc = 20170112151748:72945)       在constructor.sortItems(ext-all-rtl-debug.js?_dc = 20170112151748:73214)       在constructor.onSortChange(ext-all-rtl-debug.js?_dc = 20170112151748:73123)       在constructor.onEndUpdateSorters(ext-all-rtl-debug.js?_dc = 20170112151748:73329)       在constructor.fire(ext-all-rtl-debug.js?_dc = 20170112151748:20226)       在constructor.doFireEvent(ext-all-rtl-debug.js?_dc = 20170112151748:21133)

1 个答案:

答案 0 :(得分:0)

如果您在浮动的组件上手动调用destroy(),则在面板A关闭时,它可以解决此问题。