Added a location filter to the stock entries page

This commit is contained in:
Bernd Bestel
2022-04-03 19:28:59 +02:00
parent 5c6f84a68e
commit e69e7a9a9a
5 changed files with 38 additions and 3 deletions

View File

@@ -29,10 +29,24 @@ $.fn.dataTable.ext.search.push(function(settings, data, dataIndex)
$("#clear-filter-button").on("click", function()
{
$("#location-filter").val("all");
$("#location-filter").trigger("change");
Grocy.Components.ProductPicker.Clear();
stockEntriesTable.draw();
});
$("#location-filter").on("change", function()
{
var value = $(this).val();
var text = $("#location-filter option:selected").text();
if (value === "all")
{
text = "";
}
stockEntriesTable.column(stockEntriesTable.colReorder.transpose(5)).search(text).draw();
});
Grocy.Components.ProductPicker.GetPicker().on('change', function(e)
{
stockEntriesTable.draw();