Added a "Clear filter" button on the stock overview page (closes #879)

This commit is contained in:
Bernd Bestel
2020-08-25 20:20:51 +02:00
parent 0417b73cb5
commit f28697e5b4
4 changed files with 30 additions and 3 deletions

View File

@@ -20,8 +20,12 @@ $("#location-filter").on("change", function()
{
value = "";
}
else
{
value = "xx" + value + "xx";
}
stockOverviewTable.column(5).search("xx" + value + "xx", true, false, true).draw();
stockOverviewTable.column(5).search(value).draw();
});
$("#product-group-filter").on("change", function()
@@ -31,8 +35,12 @@ $("#product-group-filter").on("change", function()
{
value = "";
}
else
{
value = "xx" + value + "xx";
}
stockOverviewTable.column(7).search("xx" + value + "xx").draw();
stockOverviewTable.column(7).search(value).draw();
});
$("#status-filter").on("change", function()
@@ -56,6 +64,18 @@ $(".status-filter-message").on("click", function()
$("#status-filter").trigger("change");
});
$("#clear-filter-button").on("click", function()
{
$("#search").val("");
$("#status-filter").val("all");
$("#product-group-filter").val("all");
$("#location-filter").val("all");
stockOverviewTable.column(5).search("").draw();
stockOverviewTable.column(6).search("").draw();
stockOverviewTable.column(7).search("").draw();
stockOverviewTable.search("").draw();
});
$("#search").on("keyup", Delay(function()
{
var value = $(this).val();