场景:extjs怎么操作panel的html
extjs如何操作panel的html
1.如何动态修改panel里的html值
Ext.getCmp(‘panel1’).body.update('
frameborder="0" width="100%" height="100%"
src="PagingGrid11.jsp">
');
2.如何将已有HTML作为panel的body元素
contentEl
属性,值为元素的ID
extjsAPI 写道
Specify an existing HTML element, or the id of an existing HTML element to use as the content for this component.
This config option is used to take an existing HTML element and place it in the layout element of a new component (it simply moves the specified DOM element after the Component is rendered to use as the content.
Notes:
The specified HTML element is appended to the layout element of the component after any configured HTML has been inserted, and so the document will not contain this element at the time the render event is fired.
The specified HTML element used will not participate in any layout scheme that the Component may use. It is just HTML. Layouts operate on child items.
Add either the x-hidden or the x-hide-display CSS class to prevent a brief flicker of the content before it is rendered to the panel.