I have the following jquery code
function deleteAppointment(confirmationNumber)
{
// alert(confirmationNumber);
$('#left').simpledialog({
'mode' : 'bool',
'prompt' : 'Confirm Delete',
'useModal': true,
'buttons' : {
'OK': {
click:function () {
// alert(confirmationNumber);
var link;
link = ROOT_URL+'Queue/cancelreservation/confirmnumber/'+confirmationNumber;
$.ajax({
url: link,
type: 'GET',
async: true,
success: function(data){
renderAgain();
addRightPane();
$(APPOINTMENT_LIST_CLASS).animate({
scrollTop: 0
});
},
error: function(){
/*@TODO : What if the ajax request fails */
}
});
}
},
'Cancel': {
click: function () {
$('#dialogoutput').text('Cancel');
},
icon: "delete",
theme: "c"
}
}
});
}
the problem is that confirmation number I pass to the delete appointment function is only passed for the first time and is not updated the next time. It holds the value of old confirmation number so I figured out that I have to pass the confirmation number to the click function. Can any one help me on how to do that ? or what I am missing here ?
After few weeks more experience in jquerymobile I find more elegant and right way to fix this issue
just use a property of simple dialog
this will fix your problem