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