Click here to Skip to main content
12,699,308 members (24,826 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: MVC dialog jquery-ui
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 3: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
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web01 | 2.8.170118.1 | Last Updated 19 Nov 2012
Copyright © CodeProject, 1999-2017
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