Extjs 未捕获类型错误:无法读取属性';dom';空的

Extjs 未捕获类型错误:无法读取属性';dom';空的,extjs,Extjs,当第一次单击showbutton时,窗口将完全打开,但当我关闭窗口并再次打开此窗口时,在“shiftWindow.show();”行上出现错误(“无法读取null的属性'dom')。感谢您的帮助 var shiftWindow = Ext.create('Ext.window.Window', { title: 'Edit Shift', resizable: false, id: 'shiftwindow', width: 465, //bodyPadd

当第一次单击showbutton时,窗口将完全打开,但当我关闭窗口并再次打开此窗口时,在“shiftWindow.show();”行上出现错误(“无法读取null的属性'dom')。感谢您的帮助

var shiftWindow = Ext.create('Ext.window.Window', {
    title: 'Edit Shift',
    resizable: false,
    id: 'shiftwindow',
    width: 465,
    //bodyPadding: 5,
    modal: true,
    store: shiftStorePlanner,

    items: {
        xtype: 'form',
        id: 'idFormShift',
        bodyPadding: 10,
        items: shiftViewModelPlannerData
    },
    buttons: [{
        text: 'Save',
        cls: 'planner-save-button',
        overCls: 'planner-save-button-over',
        handler: function () {
            var wi = this.up('.window');
            var form = Ext.getCmp('idFormShift');
            if (form.isValid()) {
                shiftTimemappingarray = [];
                //  getShiftTime();
                setShiftTimeDetails();
            }
        }
    }, {
        text: 'Cancel',
        handler: function () {
            this.up('.window').close();
        }
    }]
});
shiftWindow.show();

如果在窗口上调用
close()
,则该窗口将被销毁。它不再存在于DOM中。您必须在调用
show()
之前再次创建它


或者,您可以
隐藏()
窗口,而不是关闭它。然后它将保留下来,不需要另一个创造物。请注意,右上角的“x”仍将触发关闭事件

在取消单击窗口时

而不是使用

this.up('.window').close();
你应该使用

this.up('.window').destroy();

因为只有这样它才会破坏整个窗口,包括dom。所以,每次你打开它,它都会是全新的……)

也许你只是没有像我一样在体内定义div元素

<div id="helloWorldPanel">
</div>

您能评论一下您觉得这个答案是否有用吗?