grocy/js/viewjs/shoppinglocations.js
Katharina Bogad 87ee45f0b1 viewjs: Move delete confirmation box to frontendhelper
More code deduplication.
2021-06-20 11:10:38 +02:00

18 lines
582 B
JavaScript

var locationsTable = $('#shoppinglocations-table').DataTable({
'order': [[1, 'asc']],
'columnDefs': [
{ 'orderable': false, 'targets': 0 },
{ 'searchable': false, "targets": 0 }
].concat($.fn.dataTable.defaults.columnDefs)
});
$('#shoppinglocations-table tbody').removeClass("d-none");
Grocy.FrontendHelpers.InitDataTable(locationsTable);
Grocy.FrontendHelpers.MakeDeleteConfirmBox(
'Are you sure to delete store "%s"?',
'.shoppinglocation-delete-button',
'data-shoppinglocation-name',
'data-shoppinglocation-id',
'objects/shopping_locations/',
'/shoppinglocations'
);