From 434525826e643d11c8fa6d4c379b3f967329a257 Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Sat, 24 Aug 2024 10:49:19 +0200 Subject: [PATCH] Fixed products page product group filter to use an exact search instead of contains (fixes #2570) --- changelog/76_UNRELEASED_xxxx-xx-xx.md | 1 + public/viewjs/products.js | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/changelog/76_UNRELEASED_xxxx-xx-xx.md b/changelog/76_UNRELEASED_xxxx-xx-xx.md index 8e383116..2c8d122b 100644 --- a/changelog/76_UNRELEASED_xxxx-xx-xx.md +++ b/changelog/76_UNRELEASED_xxxx-xx-xx.md @@ -15,6 +15,7 @@ - If the lookup was successful, the product edit page of the created product is displayed, where the product setup can be completed (if required) - After that, the transaction is continued with that product - Fixed that when copying a product, the field "Treat opened as out of stock" wasn't copied along (thanks @TheDodger) +- Fixed that the product groups filter on the master data products page used a contains search instead of an exact search ### Shopping list diff --git a/public/viewjs/products.js b/public/viewjs/products.js index 3d91986e..421ecb4d 100644 --- a/public/viewjs/products.js +++ b/public/viewjs/products.js @@ -27,10 +27,13 @@ $("#product-group-filter").on("change", function() var value = $("#product-group-filter option:selected").text(); if (value === __t("All")) { - value = ""; + productsTable.column(productsTable.colReorder.transpose(6)).search("").draw(); + } + else + { + productsTable.column(productsTable.colReorder.transpose(6)).search("^" + value + "\$", true, false).draw(); } - productsTable.column(productsTable.colReorder.transpose(6)).search(value).draw(); }); $("#clear-filter-button").on("click", function()