I have this Ajax
$(function() {
//function ajax
$('.processPreset').click(function(e) {
e.preventDefault();
var checkedNames = '';
var $things = $('.case:checked');
if ($things.length > 0) {
for (var i = 0; i < $things.length; i++) {
checkedNames += $($things[i]).closest('tr').find('td:first').text();
console.log(checkedNames);
}
$.ajax({
url: 'http://localhost:3000/processPreset',
method: 'post',
data: { idArticulo: checkedNames },
success: function(res) {
console.log(res);
// RefreshTable();
//checkedNames += $($things[i]).closest('tr').find('td:first').remove();
}
});
} else {
alert('No tiene articulo seleccionado');
}
});
});
Which makes me save a field from the table
What I am trying to do is that when I save, I remove the field from the table, either by deleting or refreshing the table