Streamline data tables

This commit is contained in:
Bernd Bestel
2018-07-09 19:27:22 +02:00
parent eca299454b
commit 54717a81b1
19 changed files with 258 additions and 85 deletions

View File

@@ -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'))
});