公司的項目沒有使用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();