Hi,
I’m trying to build in a confirmation before an ajax request is made. I’ve tried the following code, but nothing seems to happen. I don’t get the confirmation dialog and I just get passed to the controller/action.
'click'=>"function() {
if(!confirm('Update?')) return false;
function(){
$.fn.yiiGridView.update('grid', {
type:'POST',
url:$(this).attr('href'),
success:function(message) {
$('#Ajax-Flash').html(message).fadeIn().animate({opacity: 1.0}, 3000).fadeOut('slow');
$.fn.yiiGridView.update('grid');
}
})
return false;
} }
Where am I going wrong here? The standard ajax request works fine, I just wanted to add in a confirmation dialogue, so wrapped the ajax JS in a another function