GraphReportPanel = function (config, initData) {
GraphReportPanel.instance = this;
this.graphPanel = new Ext.Container({
id : 'graphPanelId'
});
GraphReportPanel.superclass.constructor.call(this, {
title : 'Graph',
autoScroll: true,
id : 'graphReportPanel',
items: [this.graphPanel],
collapsible : false
});
};
我创建了 GraphReportPanel 。现在当我使用以下代码时
Ext.getCmp('graphPanelId').el.dom.innerHTML = '';
我得到 Ext.getCmp('graphPanelId').el
作为 undefined 。为什么会这样?
最佳答案
getEl()
仅当您的组件被渲染时才返回 dom 元素。调用该方法前请检查组件是否已渲染。
希望有帮助。
关于javascript - 无法获取 Ext.Component 的 el 元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33169306/