【发布时间】:2016-03-30 14:20:22
【问题描述】:
我正在使用 jQuery UI 对话框编写应用程序。在 onSubmit 函数中,我希望用户可以确认加载文件,但由于对话框异步模式,代码没有提供确认用户选择的选项。当用户想要选择任何选项时,该功能已经结束。
有解决这个问题的办法吗?
这里是代码:
onSubmit:function(files)
{
var bucle=true;
var perm=null;
if(res=="0"){
perm=true;
}else if(res=="1"){
if(showDialog()){
perm=true;
}else{
perm=false;
}
}
else{
perm=false;
}
res=null;
return perm;
},
和 showDialog 函数:
function showDialog(){
$(function() {
$.ui.dialog.prototype._focusTabbable = function(){};
$( "#dialog-confirm" ).dialog({
resizable: false,
height:200,
width:600,
modal: true,
closeText:null,
buttons: {
Ok: function() {
$(this).dialog('close');
return true;
},
Cancel: function() {
$(this).dialog('close');
return false;
}
}
});
});
}
提前谢谢你!
【问题讨论】:
标签: javascript jquery jquery-ui asynchronous dialog