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
D-W
  • 5,201
  • 14
  • 47
  • 74
  • you might want to step through the js in chrome or firebug and see what is being selected by $("#clientEditForm") – Popo May 18 '13 at 15:07
  • renamed function, now get "Uncaught Error: cannot call methods on dialog prior to initialization; attempted to call method 'open'" – D-W May 18 '13 at 15:15

1 Answers1

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.

Craig
  • 691
  • 4
  • 20
  • Try just calling $("#clientEditForm").dialog() without the 'open' method. – Craig May 18 '13 at 15:28
  • no change, call looks like this function loadClientWindow(clientId) { console.log('Start'); $("#clientAppointmentEditForm") .load("/Client/Edit/" + clientId, function() { $("#clientAppointmentEditForm").dialog(); console.log('End'); }); } – D-W May 18 '13 at 16:01
  • Make sure you are not loading jQuery twice. See this solution: http://stackoverflow.com/questions/8786104/uncaught-typeerror-object-object-object-has-no-method-dialog – Craig May 18 '13 at 16:16
  • Nope, view does not contain any references to jquey – D-W May 18 '13 at 17:18