How to fix Javascript error: cannot call methods on dialog prior to initialization; attempted to call method

0

I have a Javascript function which takes two parameters and calls an ActionResult in my MVC to return inputs from the popup modal screen. On my results table when a user click the help button for the particular document row, it triggers this function to display a popup window so the user can send an email to enquire.

I have tried various solutions to initialize the dialog open but have not been able to solve this.

function enquire(documentId, title) {

    //$("#resultsTable").showLoading();
    $("#resultsTable").ready();

    $("#modalContent").dialog("/Home/Enquire", "open",{ propertyId: propertyId, documentId: documentId, title: title }, function () {

        $("#modalContent").ready({
            title: "Enquire about a document",
            modal: true,
            autoOpen: true,
            height: 630,
            width: 600,
            open: function (event, ui) {

                //$("#resultsTable").hideLoading();
                $("#resultsTable").ready();

            }
        });
    });

}

when this function is called an error throws up: JavaScript runtime error: cannot call methods on dialog prior to initialization; attempted to call method. The other error when I uncomment the showLoading line is: 0x800a01b6 - JavaScript runtime error: Object doesn't support property or method 'showLoading'

javascript
razor
model-view-controller
asked on Stack Overflow Apr 15, 2019 by Adish

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0