ExtJs的el和contentEl的区别
1、把<div id="div_exam"></div>嵌入到当前Ext元素panel内:
Js代码
{
fieldLabel: "上传图片",
xtype: 'panel',
contentEl: 'div_exam'
}
{
fieldLabel: "上传图片",
xtype: 'panel',
contentEl: 'div_exam'
}
效果:
Html代码
<div class="x-panel-body x-panel-body-noheader" id="ext-gen155" style="width: 500px;">
<div id="div_exam"></div>
</div>
<div class="x-panel-body x-panel-body-noheader" id="ext-gen155" style="width: 500px;">
<div id="div_exam"></div>
</div>
2、.把当前Ext元素panel嵌入到<div id="div_exam"></div>内
Js代码
{
fieldLabel: "上传图片",
width: 200,
xtype: 'panel',
el: 'div_exam'
{
fieldLabel: "上传图片",
width: 200,
xtype: 'panel',
el: 'div_exam'
}
效果:
Html代码
<div id="div_exam">
<div class="x-panel-body x-panel-body-noheader" id="ext-gen155" style="width: 500px;">....</div>
</div>