Javascript jQuery EasyUI:关闭窗口的确认
我正在使用jQueryEasyui框架。我想要一条关于关闭窗口的确认消息,如“您确定要关闭窗口吗?”。如果答案为“真”,则关闭“否则不关闭”窗口 我该怎么做呢?试试看Javascript jQuery EasyUI:关闭窗口的确认,javascript,jquery,jquery-ui,jquery-easyui,Javascript,Jquery,Jquery Ui,Jquery Easyui,我正在使用jQueryEasyui框架。我想要一条关于关闭窗口的确认消息,如“您确定要关闭窗口吗?”。如果答案为“真”,则关闭“否则不关闭”窗口 我该怎么做呢?试试看 $.messager.confirm('Confirm', 'Are you sure to exit this system?', function(r){ if (r){ // exit action; } }); 请参见试试这个 $('#windowid').window({ onBefor
$.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显示属性set none 还可以设置关闭按钮类
.panel-tool-close
{
display:none !important;
}
请试试这个
tools:[{
iconCls:'icon-cancel',
handler:function(){
if(confirm('Are you sure to close?'))
{
closeDiv();
}
else
{
}
}
}]
如何将其设置为窗口的关闭事件?