Monday, 12 August 2013

Opening JQuery Dialogs from JQuery Dialogs

Opening JQuery Dialogs from JQuery Dialogs

I am currently working on a bit of JS, and have run into an interesting
issue. I'm not sure what I'm doing wrong here, as I don't see any reason
it shouldn't work, but I'm not getting any results. I am running the
following code:
$('#am_schedDetailModal').dialog('option', 'buttons', [{
text: 'Delete',
click: function () {
$('#am_confirmationDialog').html('Are you certain you wish to
delete this entry?');
$('#am_confirmationDialog').dialog('option', 'buttons', [{
text: 'Yes',
click: function () {
deleteScheduledEntryAt(cellID);
$('#am_schedDetailModal').html('');
$('#am_schedDetailModal').dialog('close');
$('div', this).html('');
$(this).dialog('close');
}
}, {
text: 'No',
click: function () {
$('div', this).html('');
$(this).dialog('close');
}
}]);
$('#am_confirmationDialog').dialog('open');
}
}]);
The problem is that when I run this code, the second dialog doesn't
appear. The first dialog appears, and the other buttons work fine, but the
'Delete' button has no effect at all. There is no error (according to
FireBug), but nothing shows up. Any suggestions?

No comments:

Post a Comment