【发布时间】:2013-06-12 06:04:44
【问题描述】:
我正在使用 jQuery EasyUI 框架。我想在关闭窗口上显示确认消息,例如“您确定要关闭窗口吗?”。如果答案为真则关闭,否则不关闭窗口。
我该怎么做?
【问题讨论】:
标签: javascript jquery jquery-ui jquery-easyui
我正在使用 jQuery EasyUI 框架。我想在关闭窗口上显示确认消息,例如“您确定要关闭窗口吗?”。如果答案为真则关闭,否则不关闭窗口。
我该怎么做?
【问题讨论】:
标签: javascript jquery jquery-ui jquery-easyui
试试
$.messager.confirm('Confirm', 'Are you sure to exit this system?', function(r){
if (r){
// exit action;
}
});
【讨论】:
试试这个,
$('#windowid').window({
onBeforeClose: function(){
$.messager.confirm('Confirm', 'Are you sure to exit this system?', function(r)
{
if (r){
return true;
}
else{return false;}
});
}
});
【讨论】:
此功能并非由 Easy-UI 直接提供 如果你愿意,那么你需要禁用窗口的关闭按钮喜欢
.panel-tool-close
{
display:none !important;
}
并添加您的自定义工具栏 像这样在 document.ready 函数中
jQuery('#divSeguimientos').window({
collapsible:false,
minimizable:false,
maximizable:false,
tools:[{
iconCls:'icon-cancel',
handler:function(){
if(confirm('Are you sure to close the window?'))
{
closeDivSeguimientos();
}
else
{
}
}
}]
});
【讨论】:
easy ui 不提供此功能。 所以你必须隐藏或设置关闭按钮的css显示属性设置为无。
还设置关闭按钮类。
.panel-tool-close
{
display:none !important;
}
请试试这个。
tools:[{
iconCls:'icon-cancel',
handler:function(){
if(confirm('Are you sure to close?'))
{
closeDiv();
}
else
{
}
}
}]
【讨论】: