Fixed DataTables numeric/datetime sorting (fixes #1085)

This commit is contained in:
Bernd Bestel
2020-12-17 17:33:24 +01:00
parent bbad049880
commit b5fc64cf5d
10 changed files with 36 additions and 22 deletions

View File

@@ -2,7 +2,9 @@
'order': [[2, 'desc']],
'columnDefs': [
{ 'orderable': false, 'targets': 0 },
{ 'searchable': false, "targets": 0 }
{ 'searchable': false, "targets": 0 },
{ "type": "html", "targets": 3 },
{ "type": "html", "targets": 4 }
].concat($.fn.dataTable.defaults.columnDefs)
});
$('#batteries-overview-table tbody').removeClass("d-none");

View File

@@ -2,7 +2,10 @@
'order': [[2, 'desc']],
'columnDefs': [
{ 'orderable': false, 'targets': 0 },
{ 'searchable': false, "targets": 0 }
{ 'searchable': false, "targets": 0 },
{ "type": "html", "targets": 5 },
{ "type": "html", "targets": 2 },
{ "type": "html", "targets": 3 }
].concat($.fn.dataTable.defaults.columnDefs)
});
$('#chores-overview-table tbody').removeClass("d-none");

View File

@@ -2,7 +2,8 @@
'order': [[1, 'asc']],
'columnDefs': [
{ 'orderable': false, 'targets': 0 },
{ 'searchable': false, "targets": 0 }
{ 'searchable': false, "targets": 0 },
{ "type": "html-num-fmt", "targets": 3 }
].concat($.fn.dataTable.defaults.columnDefs)
});
$('#products-table tbody').removeClass("d-none");

View File

@@ -2,7 +2,8 @@
'order': [[1, 'asc']],
'columnDefs': [
{ 'orderable': false, 'targets': 0 },
{ 'searchable': false, "targets": 0 }
{ 'searchable': false, "targets": 0 },
{ "type": "html-num-fmt", "targets": 2 },
].concat($.fn.dataTable.defaults.columnDefs),
select: {
style: 'single',

View File

@@ -6,7 +6,8 @@ var shoppingListTable = $('#shoppinglist-table').DataTable({
'columnDefs': [
{ 'orderable': false, 'targets': 0 },
{ 'searchable': false, "targets": 0 },
{ 'visible': false, 'targets': 3 }
{ 'visible': false, 'targets': 3 },
{ "type": "num", "targets": 2 }
].concat($.fn.dataTable.defaults.columnDefs),
'rowGroup': {
enable: true,

View File

@@ -10,7 +10,11 @@
{ 'visible': false, 'targets': 2 },
{ 'visible': false, 'targets': 4 },
{ 'visible': false, 'targets': 9 },
{ 'visible': false, 'targets': 10 }
{ 'visible': false, 'targets': 10 },
{ "type": "num", "targets": 3 },
{ "type": "html-num-fmt", "targets": 9 },
{ "type": "html-num-fmt", "targets": 10 },
{ "type": "html", "targets": 5 }
].concat($.fn.dataTable.defaults.columnDefs)
});

View File

@@ -3,7 +3,8 @@
'columnDefs': [
{ 'orderable': false, 'targets': 0 },
{ 'searchable': false, "targets": 0 },
{ 'visible': false, 'targets': 3 }
{ 'visible': false, 'targets': 3 },
{ "type": "html", "targets": 2 }
].concat($.fn.dataTable.defaults.columnDefs),
'rowGroup': {
enable: true,