Issue:not able to close modal dialog
I have the following code, it works for me, the dialog is opened.
$("#invitation-form").dialog({
autoOpen: true,
height: 300,
width: 600,
modal: true,
title: 'Send Invitation',
open: function() {
$("#invitation-form").html("<%= escape_javascript(render('invitation_form.html')) %>")
}
});
Inside the invitation form, after user click the “send” button,
it will trigger and function in the controller, it is and ajax call, coz i set :remote => true
and i try to do the following
$("#invitation-form").dialog("close")
the dialog does NOT close.
i put and alert message to test it, it run through the the code, i can see the alert message.
can anyone help me, how can i close the dialog?
Thanks
You should try setting the dialog up as not to
autoOpen:And then you can just call
openon page load if you want, andclosewhenever you want to as well: