var t = false;//判断是否要关闭
var tabPs = window.tabs;//获得定义为全局的tablePanel对象
var curPanel = tabPs.getActiveTab();//获得当前活动的panel
curPanel.on('beforeclose',function(){
//判断是否关闭
Ext.Msg.show({
title:'提示',
msg:'是否关闭本窗口',
icon: Ext.MessageBox.QUESTION,
buttons: {yes:i18n_saveButton,no:i18n_cancel},
fn: function(option)
{
if(option=='yes')
{
t = true;
curPanel.destroy();//调用销毁
}else{
tabPs.activate(curPanel);
return false;
}
}
});
return false;
});
curPanel.on(
'beforedestroy',function(tab){//在销毁对象前,判断用户是否要关闭窗口,好像在点击关闭按钮时,ext就异步开始销毁页面元素,所以不这样时,前面的Ext.Msg.alert()就显示不出来
if(false == t){
return false;
}
return true;
}
);
var tabPs = window.tabs;//获得定义为全局的tablePanel对象
var curPanel = tabPs.getActiveTab();//获得当前活动的panel
curPanel.on('beforeclose',function(){
//判断是否关闭
Ext.Msg.show({
title:'提示',
msg:'是否关闭本窗口',
icon: Ext.MessageBox.QUESTION,
buttons: {yes:i18n_saveButton,no:i18n_cancel},
fn: function(option)
{
if(option=='yes')
{
t = true;
curPanel.destroy();//调用销毁
}else{
tabPs.activate(curPanel);
return false;
}
}
});
return false;
});
curPanel.on(
'beforedestroy',function(tab){//在销毁对象前,判断用户是否要关闭窗口,好像在点击关闭按钮时,ext就异步开始销毁页面元素,所以不这样时,前面的Ext.Msg.alert()就显示不出来
if(false == t){
return false;
}
return true;
}
);