日期:2014-05-16  浏览次数:20353 次

extjs panel练习
Ext.onReady(function(){
	var pan=new Ext.Panel({
		title:"my panel",
		width:600,
		height:600,
		//添加工具图标
		tools:[{id:"save"},{id:"print",handler:function(){window.print();}}],
		tbar:[{text:"设备详情",handler:function(){
			pan.add({title:"this is new panel"});
			//此语句意思为重新布局面板,当动态添加面板时必须使用该方法
			alert("running here");
//			pan.dolayout();
			pan.doLayout();
			pan.remove("p3")
		}},{text:"设备数量"}],
		bbar:[{text:"上一页"},{text:"下一页"}],
		buttons:[{text:"确定"},{text:"取消"}],
		items:[{id:"p3",title:"this is other panel",width:200,height:300}]
	});
//	pan.render("div1");
	pan.render(document.body);
});

?需注意字符大小写