用window實現類似Ext.msg.alert()效果

公司的項目沒有使用ifram,所以整個項目就一張頁面,導致當使用Ext.msg.alert()後會遮罩整個界面。如果我只想遮罩右邊的tab而讓左邊的tree依然還能用的話就只有重寫一個window來代替alert。然後自己再通過mask()方法來手工控制遮罩

Ext.create('Ext.window.Window', {
				title : title,
				id : id,
				renderTo : renderTo,
				resizable : false,
				constrain : true,
				border : false,
				cls : Ext.baseCSSPrefix + 'message-box',
				buttonAlign : 'center',
				width : 250,
				height : 115,
				items : [{
							xtype : 'container',
							anchor : '100%',
							style : {
								padding : '10px',
								overflow : 'hidden'
							},
							items : [{
										xtype : 'image',
										src : '/btoc/resource/app/images/icon-question.gif',
										width : 32,
										height : 32,
										style : {
											'float' : 'left'
										}
									}, {
										xtype : 'label',
										padding : '0 0 0 20',
										text : msg
									}]
						}],
				buttons : [{
							text : '確定',
							handler : ok
						}, {
							text : '取消',
							handler : function(btn) {
								btn.up('window').close();
							}
						}]
			}).show();

 

 

 

發佈了15 篇原創文章 · 獲贊 1 · 訪問量 2萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章