【发布时间】:2013-12-07 05:28:46
【问题描述】:
想象以下情况,我有以下 HTML 文档:
<html>
<head>... include all the js and css here...</head>
<body>
<div class="placeholderForExtPanel"></div>
</body>
</html>
现在在我的代码中,我告诉 ExtJS 在我的占位符中呈现一个面板。
var container = Ext.select('.placeholderForExtPanel');
Ext.create('Ext.form.Panel', {
title: 'My Panel'
});
稍后,代码的其他部分决定从 DOM 中删除占位符 div。
Ext.select('.placeholderForExtPanel').first().remove();
在这种情况下,之前声明的 Panel 会发生什么?我是否需要手动销毁它,或者 ExtJS 是否知道它的包含元素刚刚从 DOM 中删除,它应该自行销毁 Panel?我正在使用 ExtJS 4.1。
【问题讨论】:
标签: javascript extjs garbage-collection