Bug 32016: Fix clear filter button behavior
authorThibaud Guillot <thibaud.guillot@biblibre.com>
Thu, 27 Oct 2022 12:15:19 +0000 (14:15 +0200)
committerLucas Gass <lucas@bywatersolutions.com>
Wed, 18 Jan 2023 21:00:22 +0000 (21:00 +0000)
commitb14493c9088c2e704328065d5e3cffbd664b6faf
tree6d8d939dbbe96b89395f63c389c4b4583433fb28
parent3622b51abb082bb009ed6568454ddfff17a3c522
Bug 32016: Fix clear filter button behavior

For example, if you filter by global search input a datatable which saves its previous state when you want to return to this datatable, the backup is recovered in a cookie but the "clear filter" button is disabled because for it the input is empty, the verification of the recovery of the cookie not being made.

When loading I therefore added the verification of the cookie and if the search value is not empty then the button can be activated.

Test plan:

1) Be sure to have some orders and baskets which can be received
2) Go to 'cgi-bin/koha/acqui/booksellers.pl' and click on 'Receive
shipments'
3) Enter something in global search
4) Go to receive and cancel or save to be back on datatable
5) See that you cannot remove your previous input by the 'clear filter'
button
6) Apply this patch
7) Repeat steps 3) and 4)
8) See that now you can remove your search

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
https://bugs.koha-community.org/show_bug.cgi?id=31881
(cherry picked from commit a054207896610e02ab26a2c6447509d64685094a)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
koha-tmpl/intranet-tmpl/prog/js/datatables.js