Click here to Skip to main content
11,567,143 members (48,084 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: MVC dialog JQueryUI
I want to close a jquery dialogbox without blocking the UI or reloading the page.
On closing a jquery dialog like this:

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
buttons: {
                        "Close": function () {
                            $("#quickfillDialog").dialog("close");
                        }

that also doesnt solve the issue. Please suggest!!
Posted 19-Nov-12 2:41am

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You should do something like this:

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[^]
  Permalink  

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

  Print Answers RSS


Advertise | Privacy | Mobile
Web04 | 2.8.150624.2 | Last Updated 19 Nov 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100