简体   繁体   English

Jquery ui Dialog Modal True

[英]Jquery ui Dialog Modal True

I am use jQuery v1.8.2 and jQuery UI v1.9.2. 我使用的是jQuery v1.8.2和jQuery UI v1.9.2。

so My Problem is that. 所以我的问题是。

On Button click event i have close the dialog 在按钮单击事件上,我已关闭对话框

$('#oldInvoiceDialogDiv').dialog('close');

But Modal Property Remaining 但Modal Property Remaining

Means after close dialog do not working like ui-widget-overlay property Dialog 关闭对话框后的意思不像ui-widget-overlay属性对话框那样工作

$("#oldInvoiceDialogDiv").dialog({
        autoOpen : false,
        resizable : false,
        width : 855,
        modal : true,
        close : function(ev, ui) {

        }
    });

so What is my Fault. 那我的错是什么 Please tell me Thanks in advance 请提前告诉我

If you are not doing anything in your close callback function remove it. 如果您在close close函数中没有执行任何操作,请将其删除。 If you do want to use it i think that this function should return Boolean at the end so try to add return true statement. 如果你想使用它,我认为这个函数应该在结尾返回布尔值,所以尝试添加return true语句。

EDIT 编辑

Make sure that you initialize your dialog inside document ready handler: 确保在文档就绪处理程序中初始化对话框:

$(document).ready(function(){
    $("#oldInvoiceDialogDiv").dialog({
            autoOpen : false,
            resizable : false,
            width : 200,
            height:200,
            modal : true,
            buttons: {
                "Close Dialog" : function(){
                    $( this ).dialog( "close" );
                }
            },
            close : function(ev, ui) {
                alert("in Close");
                return true;    
            }
        });
    $('#btnOpen').click(function(){
         $("#oldInvoiceDialogDiv").dialog("open");
    })
});

Check this fiddle , i think it exactly your case. 检查这个小提琴 ,我认为这完全是你的情况。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM