ExtJs--06--Ext.WindowGroup相关方法简单使用

Ext.onReady(function(){
	
	
//用windowGroup对象去操作多个window窗体
var winG = new Ext.WindowGroup();
for (var i = 1; i <= 5; i++) {
	var win = Ext.create("Ext.Window",{
		id:"win_"+i,
		title:"第"+i+"个窗体",
		width:200,
		height:200,
		renderTo:Ext.getBody()
	});
	win.show();
	winG.register(win);
}
var btn1 = Ext.create("Ext.button.Button",{
	text:"所有隐藏",
	renderTo:Ext.getBody(),
	handler:function(btn){
		winG.hideAll();
		
	}
});
var btn2 = Ext.create("Ext.button.Button",{
	text:"所有显示",
	renderTo:Ext.getBody(),
	handler:function(btn){
		winG.each(function(win){
			win.show();
		})
	}
});

var btn3 = Ext.create("Ext.button.Button",{
	text:"将第二个显示在最前端",
	renderTo:Ext.getBody(),
	handler:function(btn){
		winG.bringToFront("win_2");
	}
});
var btn4 = Ext.create("Ext.button.Button",{
	text:"将第二个显示在最底端",
	renderTo:Ext.getBody(),
	handler:function(btn){
		winG.sendToBack("win_2")
	}
});
	
})

posted @ 2017-06-30 16:44  lytwajue  阅读(332)  评论(0编辑  收藏  举报