how can i prevent/invoke $ajax by pressing Cancel or Ok button by calling myConfirm function ? currently i get undefined if i try with:
var vCal = myConfirm('dialogText', 'dialogTitle');
do i missed something ?
function myConfirm(dialogText, dialogTitle) {
$('<div style="padding: 10px; max-width: 500px; word-wrap: break-word;">' + dialogText + '</div>').dialog({
.....
buttons: {
"OK" : function (e) {
console.log('yes');
$(this).dialog('destroy');
return true;
},
"Abbrechen" : function (e) {
console.log('no');
$(this).dialog('destroy');
return false;
}
}
});
}
function openTickerDialogDelete (id) {
....
if(!myConfirm('dialogText', 'dialogTitle')) {
return false;
}
console.log('call ajax');
$.ajax({
.....
success: function( data ) {
}
})
}
using return confirm() works great, but i would like to use the dialog box
thank you