日期:2014-05-16 浏览次数:20454 次
<html>
<head>
<link rel="stylesheet" type="text/css" href="./ExtJS4/resources/css/ext-all.css" />
<script type="text/javascript" src="./ExtJS4/ext-all.js"></script>
<script type="text/javascript">
Ext.onReady(function() {
var btn = new Ext.Button({
text : "Change",
handler : function() {
var items=Ext.getCmp('central').items;
Ext.getCmp('central').remove(items.keys[0]);
Ext.getCmp('central').add(panel2);
}
});
var panel2 = new Ext.Panel({
itemId : 'panel2',
border : false,
title : 'panel2',
frame : true
});
var panel1 = new Ext.Panel({
itemId : 'panel1',
border : false,
title : 'panel1',
frame : true
});
var viewport = new Ext.Viewport({
border : false,
layout : 'border',
items : [ {
split : true,
region : 'north',
frame : true,
height : 60,
items : [ btn ]
}, {
split : true,
&n