There must be a cleaner way to do what i'm trying to do here...
I have a jquery Ui dialog box that opens when i click on the eventClick handler in the FullCalendar plugin.
The dialog box contains the details of the event. On the bottom of the form there should be an edit button, that will close the dialog box down and open a new one with an editable form in it.
For the most part i've succeeded, in the sense that the edit button does indeed bring up the edit form in a dialog box. BUT it's not a new dialog box, it's the same dialog box from the first click, with the OK and edit buttons on it.
How do a i get a new dialog box to open for the edit form?
Below is the eventClick function
eventClick: function(event) {
if (event.url) {
$('#details')
.load(event.url)
.dialog({
title: 'Event Details',
buttons: { "Ok": function() { $(this).dialog("close"); },
"Edit": function() {
$(this).dialog("close");
$('#details').load('/Events/Edit/' + event.id)
.dialog({
title: 'Edit'
});
} }
});
return false;
}
},