0

Ive got a ASP.NET page that has a link that opens a dialog window "edit appointment", which works fine

function editAppointment(event) {
        $("#editAppointment")
            .load("/Schedule/Edit/" + event.id,
                function() {
                $("#editAppointment").dialog('open');

                });

    }
function loadClient(clientId) {
            alert('hi');
            $("#clientEditForm")
               .load("/Client/Edit/", function() {
                   $("#clientEditForm").dialog('open');
               });
        }

Within the page "/Schedule/Edit/" has a link to open the dialog "loadClient"

The function is called ok, but does not show another dialog window it use to work with an older version of jquery ui/jquery, now using the latest versions!, all I get is a javascript error

Uncaught TypeError: Object [object Object] has no method 'dialog' Schedule:346
(anonymous function) Schedule:346
b.extend.each jquery.1.9.1.min.js:4
b.fn.b.each jquery.1.9.1.min.js:4
(anonymous function) jquery.1.9.1.min.js:19
c jquery.1.9.1.min.js:4
p.fireWith jquery.1.9.1.min.js:4
k jquery.1.9.1.min.js:19
r
2
  • you might want to step through the js in chrome or firebug and see what is being selected by $("#clientEditForm") Commented May 18, 2013 at 15:07
  • renamed function, now get "Uncaught Error: cannot call methods on dialog prior to initialization; attempted to call method 'open'" Commented May 18, 2013 at 15:15

1 Answer 1

0

jQuery is not finding the #clientEditForm element. Could it be that the /Client/Edit/ page is not loading properly? Based on your loadClient method, I assume you may actually want to load /Client/Edit/:clientId.

Sign up to request clarification or add additional context in comments.

4 Comments

Try just calling $("#clientEditForm").dialog() without the 'open' method.
no change, call looks like this function loadClientWindow(clientId) { console.log('Start'); $("#clientAppointmentEditForm") .load("/Client/Edit/" + clientId, function() { $("#clientAppointmentEditForm").dialog(); console.log('End'); }); }
Make sure you are not loading jQuery twice. See this solution: stackoverflow.com/questions/8786104/…
Nope, view does not contain any references to jquey

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.