Click here to Skip to main content
15,886,069 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to close a jquery dialogbox without blocking the UI or reloading the page.
On closing a jquery dialog like this:

C#
buttons: {
                       "Close": function () {
                           e.preventDefault();
                           $(".ui-dialog").remove();
                           $(".ui-widget-overlay").remove();
                       }


the dialog gets hideen but,the UI behind gets blocked. hence i cant click on other links..
Also tried
C#
buttons: {
                        "Close": function () {
                            $("#quickfillDialog").dialog("close");
                        }


that also doesnt solve the issue. Please suggest!!
Posted

1 solution

You should do something like this:

C#
var allOptions = options ? options : {};
    allOptions.close = function () {
        {do something}
    };
    jQuery('{selector}').dialog(allOptions);


There is no need to overriding buttons. Add event handler for close.
Also if you not doing anything in that function there is no need to add it at all. Dialog should do fine by it self.
See
http://jqueryui.com/dialog/#modal[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900