Ajax events on grid

hi,
if you add an event to the click on the grid field, when the message comes out, the deletion and refresh has been made, why? should wait for the answer and then cancel !!!

Your code is executed on the server side, not the client, that is why it’s not waiting for your input

You need to do it on the client side, a good solution will be to do it in jQuery with Ajax

ex.

$(’.removeItem’).click(function (event) {
if (confirm(‘Are you sure you want to delete this?’)) {
$.ajax({
url: ‘myUrl’,
type: “POST”,
data: {
// data stuff here
},
success: function () {
// does some stuff here…
}
});
}
});

1 Like

sorry but this code not work.
where should I add this code ?
but it is not possible that nothing native exists in SC.

This is not working code, it’s just a structural sample that should be adapt to your app

In your case it should probably be in a javascript button

1 Like