mirror of
https://github.com/grocy/grocy.git
synced 2026-04-05 20:36:15 +02:00
30 lines
787 B
JavaScript
30 lines
787 B
JavaScript
function quantityunitsView(Grocy, scope = null)
|
|
{
|
|
var $scope = $;
|
|
if (scope != null)
|
|
{
|
|
$scope = (scope) => $(scope).find(scope);
|
|
}
|
|
|
|
var quantityUnitsTable = $scope('#quantityunits-table').DataTable({
|
|
'order': [[1, 'asc']],
|
|
'columnDefs': [
|
|
{ 'orderable': false, 'targets': 0 },
|
|
{ 'searchable': false, "targets": 0 }
|
|
].concat($.fn.dataTable.defaults.columnDefs)
|
|
});
|
|
$scope('#quantityunits-table tbody').removeClass("d-none");
|
|
Grocy.FrontendHelpers.InitDataTable(quantityUnitsTable);
|
|
Grocy.FrontendHelpers.MakeDeleteConfirmBox(
|
|
'Are you sure to delete quantity unit "%s"?',
|
|
'.quantityunit-delete-button',
|
|
'data-quantityunit-name',
|
|
'data-quantityunit-id',
|
|
'objects/quantity_units/',
|
|
'/quantityunits'
|
|
);
|
|
}
|
|
|
|
|
|
window.quantityunitsView = quantityunitsView
|