Bug 36129: Make check on "Hide all columns" persist on item patch modification/deletion

On item patch modification/deletion tool, if one checks
"Hide all columns" checkbox and then reloads the page,
checkbox is no longer selected. Columns are hidden as
they should. This patch adds line to batchMod.js which
sets "checked" attribute and class "selected" to checkbox.

To test:
1. Find items to modify/delete and modify/delete them with
corresponding tool.
2. Check checkbox "Hide all columns".
3. Refresh the page.
=> Note that columns are still hidden, but checkbox is now
unselected.
4. Apply this patch.
5. Check checkbox again and refresh page.
=> Checkbox should be still checked.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Emmi Takkinen 2024-02-19 12:55:26 +02:00 committed by Martin Renvoize
parent 628f84bdec
commit 1a154f1f0e
Signed by: martin.renvoize
GPG key ID: 422B469130441A0F

View file

@ -20,6 +20,7 @@ function hideColumns() {
if (valCookie) {
valCookie = valCookie.split("/");
$("#showall").prop("checked", false).parent().removeClass("selected");
$("#hideall").prop("checked", true).parent().addClass("selected");
for ( var i = 0; i < valCookie.length; i++ ) {
if (valCookie[i] !== '') {
var index = valCookie[i] - nb_cols;