mirror of
https://github.com/grocy/grocy.git
synced 2025-08-18 11:27:03 +00:00
Added a location filter to the stock entries page
This commit is contained in:
@@ -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();
|
||||
|
Reference in New Issue
Block a user