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,5 +1,5 @@
$('#batteries-overview-table').DataTable({
'bPaginate': false,
var batteriesOverviewTable = $('#batteries-overview-table').DataTable({
'paginate': false,
'order': [[2, 'desc']],
'columnDefs': [
{ 'orderable': false, 'targets': 0 }
@@ -7,6 +7,17 @@
'language': JSON.parse(L('datatables_localization'))
});
$("#search").on("keyup", function()
{
var value = $(this).val();
if (value === "all")
{
value = "";
}
batteriesOverviewTable.search(value).draw();
});
$(document).on('click', '.track-charge-cycle-button', function(e)
{
var batteryId = $(e.currentTarget).attr('data-battery-id');