简体   繁体   中英

Jquery ui Dialog Modal True

I am use jQuery v1.8.2 and 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

Means after close dialog do not working like ui-widget-overlay property Dialog

$("#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. 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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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