mirror of
https://github.com/grocy/grocy.git
synced 2025-08-18 11:27:03 +00:00
Streamline data tables
This commit is contained in:
@@ -1,4 +1,24 @@
|
||||
$(document).on('click', '.location-delete-button', function(e)
|
||||
var locationsTable = $('#locations-table').DataTable({
|
||||
'paginate': false,
|
||||
'order': [[1, 'asc']],
|
||||
'columnDefs': [
|
||||
{ 'orderable': false, 'targets': 0 }
|
||||
],
|
||||
'language': JSON.parse(L('datatables_localization'))
|
||||
});
|
||||
|
||||
$("#search").on("keyup", function()
|
||||
{
|
||||
var value = $(this).val();
|
||||
if (value === "all")
|
||||
{
|
||||
value = "";
|
||||
}
|
||||
|
||||
locationsTable.search(value).draw();
|
||||
});
|
||||
|
||||
$(document).on('click', '.location-delete-button', function (e)
|
||||
{
|
||||
var objectName = $(e.currentTarget).attr('data-location-name');
|
||||
var objectId = $(e.currentTarget).attr('data-location-id');
|
||||
@@ -33,12 +53,3 @@
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#locations-table').DataTable({
|
||||
'bPaginate': false,
|
||||
'order': [[1, 'asc']],
|
||||
'columnDefs': [
|
||||
{ 'orderable': false, 'targets': 0 }
|
||||
],
|
||||
'language': JSON.parse(L('datatables_localization'))
|
||||
});
|
||||
|
Reference in New Issue
Block a user