Reputation: 181
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
});
};
I have created GraphReportPanel . Now when i use the following code
Ext.getCmp('graphPanelId').el.dom.innerHTML = '';
I get Ext.getCmp('graphPanelId').el
as undefined . Why is it so?
Upvotes: 1
Views: 314
Reputation: 14589
getEl()
returns the dom element only if your component is rendered. Please check if the component is rendered before you call this method.
Hope it helps.
Upvotes: 1
Reputation: 776
Use Ext.getCmp('graphPanelId').getEl()
instead of Ext.getCmp('graphPanelId').el
.
More information in this topic : Can you please explain .el, getEl(), Ext.get() in detail?
Upvotes: 0