Továbbfejlesztés
This commit is contained in:
@@ -73,46 +73,9 @@
|
||||
|
||||
$('#tbLocationsPage').on('click', '.delete-btn', function ()
|
||||
{
|
||||
const row = table.row($(this).closest('tr')).data();
|
||||
showConfirmModal({
|
||||
title: 'Törlés megerősítése',
|
||||
message: 'Biztosan törölni szeretnéd ezt az elemet?',
|
||||
okText: 'Törlés',
|
||||
cancelText: 'Mégsem'
|
||||
}).then(function(result) {
|
||||
if(result === 'ok') {
|
||||
$.ajax({
|
||||
url: '/BaseStock/Locations/LocationsPage?handler=DeleteLocation',
|
||||
type: 'GET',
|
||||
data: { id: row.id },
|
||||
success: function (data) {
|
||||
console.log(data);
|
||||
if (data) {
|
||||
showMessageModal({
|
||||
title: 'Információ',
|
||||
message: 'A törlés sikerült!',
|
||||
okText: 'Értettem'
|
||||
});
|
||||
var row = table.row($(this).closest('tr')).data();
|
||||
|
||||
table.ajax.reload();
|
||||
} else {
|
||||
showMessageModal({
|
||||
title: 'Hiba!',
|
||||
message: 'A törlés NEM sikerült!',
|
||||
okText: 'Értettem'
|
||||
});
|
||||
}
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
showMessageModal({
|
||||
title: 'Hiba!',
|
||||
message: 'A törlés NEM sikerült!',
|
||||
okText: 'Értettem'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
deleteEntity(table, '/BaseStock/Locations/LocationsPage?handler=DeleteLocation', row.id);
|
||||
});
|
||||
</script>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user