Add "Reset Sorting" button to remaining pages.

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2019-12-20 08:35:29 +00:00
parent 4f54796286
commit ede9d41341
7 changed files with 52 additions and 4 deletions

View File

@@ -99,6 +99,7 @@ function initTable() {
},
order: [[0, "asc"]],
columns: [
{ data: "id", visible: false },
{ data: "address" },
{ data: "enabled", searchable: false },
{ data: "comment" },
@@ -201,6 +202,19 @@ function initTable() {
return data;
}
});
table.on("order.dt", function() {
var order = table.order();
if (order[0][0] !== 0 || order[0][1] !== "asc") {
$("#resetButton").show();
} else {
$("#resetButton").hide();
}
});
$("#resetButton").on("click", function() {
table.order([[0, "asc"]]).draw();
$("#resetButton").hide();
});
}
function addAdlist() {