locked
Dialog Box not opening RRS feed

  • Question

  • User1979860870 posted

    Hi

       Dialog Box not opening , neither any error message appears

    $(document).ready(function () {
        loadData();
    
        $("#dialog").dialog({
            autoOpen: false,
            modal: true,
            closeOnEscape: false,
            buttons: {
                "Ok": function () {
                    $.ajax({
                        url: "/Location/Delete/",
                        type: "POST",
                        data: { Id: Id },
                        success: function () {
                            //alert("success");
                            $(this).dialog("close");
                        },
                        error: function (data) {
                            alert(data.x);
                        }
                    });
                },
                "Cancel": function () {
                    $(this).dialog("close");
                }
            }
        });
    });
    
    
    
    function Delete(Id) {
        $("#dialog").dialog("open");
        
    }

    Thanks

    Sunday, May 16, 2021 7:07 AM

All replies

  • User475983607 posted

    How is the Delete function called?  Does the #dialog ID exist?  Can you explain what troubleshooting steps you performed?

    Keep in mind, it is much easier to provide assistance when you share enough code to reproduce the issue.  

    Sunday, May 16, 2021 10:28 AM
  • User287926715 posted

    Hi jagjit saini,

    If autoOpen is set to true, the dialog box will automatically open when it is initialized.

    If false, the dialog will remain hidden until open() calls this method.

    Like the Delete method below, how did you call the method?

    Best Regards,

    ChaoDeng

    Monday, May 17, 2021 6:40 AM