contentEl是将div内容放到panel中,然后对panel进行布局
可以将网页头部内容在div写好后 通过contentEl放到Panel中,然后对panel进行布局
renderTo 是将panel内容放到div中
网页头部如果用renderTo写的话就在panel中加
html : '<table></table>',
将html中的代码写好放到div中
这样写好麻烦,还是推荐下面的方法
<div id="con"></div>
//将div内容放到panel中
var bannerPanel = Ext.create('Ext.Panel', {
id: 'bannerPanel',
height: 70,
frame: true,
contentEl: 'con'
});
//布局
Ext.create('Ext.container.Viewport', {
layout: {
type: 'border',
regionWeights: {
west: -1,
north: 1,
south: 1,
east: -1
}
},
defaults: {
border: false
},
items: [{
region: 'west',
layout: 'fit',
width: 240,
split: true,
collapsible: true,
header: false,
items: [xx]
}, {
region: 'center',
layout: 'fit',
items: [xx]
}, {
region: 'north',
layout: 'fit',
items: [bannerPanel]
}]
});