Ext.panel.Panel:這是允許在正常面板中添加項(xiàng)目的基本容器。
這里是創(chuàng)建Ext.panel.Panel容器的簡(jiǎn)單語法:
Ext.create('Ext.panel.Panel', {
items: [child1, child2] // this way we can add differnt child elements to the container as container items.
});
下面是一個(gè)簡(jiǎn)單的例子顯示Ext.panel.Panel Container
<!DOCTYPE html>
<html>
<head>
<link href="./ext-6.0.0/build/classic/theme-classic/resources/theme-classic-all.css" rel="stylesheet">
<script src="./ext-6.0.0/build/ext-all.js"></script>
<script type="text/javascript">
Ext.onReady(function () {
var childPanel1 = Ext.create('Ext.Panel', {
html: 'First Panel'
});
var childPanel2 = Ext.create('Ext.Panel', {
html: 'Another Panel'
});
Ext.create('Ext.panel.Panel', {
renderTo: Ext.getBody(),
width: 100,
height : 100,
border : true,
frame : true,
items: [ childPanel1, childPanel2 ]
});
});
</script>
</head>
<body>
</body>
</html>
這將產(chǎn)生以下結(jié)果:
更多建議: