Use original column index when accessing data table columns (fixes #1684)

This commit is contained in:
Bernd Bestel 2021-11-12 18:26:19 +01:00
parent 4338ccc132
commit 2a2335c8f4
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300
11 changed files with 30 additions and 29 deletions

View File

@ -7,6 +7,7 @@
- Fixed that the "Add as new product" productpicker workflow, started from the shopping list item form, always selected the default shopping list after finishing the flow - Fixed that the "Add as new product" productpicker workflow, started from the shopping list item form, always selected the default shopping list after finishing the flow
- Fixed that when undoing a product opened transaction and when the product has "Default due days after opened", the original due date wasn't restored - Fixed that when undoing a product opened transaction and when the product has "Default due days after opened", the original due date wasn't restored
- Fixed that "Track date only"-chores were shown as overdue on the due day on the chores overview page - Fixed that "Track date only"-chores were shown as overdue on the due day on the chores overview page
- Fixed that dropdown filters for tables maybe did not work after reordering columns
### API ### API
- Fixed that backslashes were not allowed in API query filters - Fixed that backslashes were not allowed in API query filters

View File

@ -25,7 +25,7 @@ $("#clear-filter-button").on("click", function()
{ {
$("#search").val(""); $("#search").val("");
$("#status-filter").val("all"); $("#status-filter").val("all");
batteriesOverviewTable.column(5).search("").draw(); batteriesOverviewTable.column(batteriesOverviewTable.colReorder.transpose(5)).search("").draw();
batteriesOverviewTable.search("").draw(); batteriesOverviewTable.search("").draw();
}); });
@ -40,7 +40,7 @@ $("#status-filter").on("change", function()
// Transfer CSS classes of selected element to dropdown element (for background) // Transfer CSS classes of selected element to dropdown element (for background)
$(this).attr("class", $("#" + $(this).attr("id") + " option[value='" + value + "']").attr("class") + " form-control"); $(this).attr("class", $("#" + $(this).attr("id") + " option[value='" + value + "']").attr("class") + " form-control");
batteriesOverviewTable.column(5).search(value).draw(); batteriesOverviewTable.column(batteriesOverviewTable.colReorder.transpose(5)).search(value).draw();
}); });
$(".status-filter-message").on("click", function() $(".status-filter-message").on("click", function()

View File

@ -33,7 +33,7 @@ $("#status-filter").on("change", function()
// Transfer CSS classes of selected element to dropdown element (for background) // Transfer CSS classes of selected element to dropdown element (for background)
$(this).attr("class", $("#" + $(this).attr("id") + " option[value='" + value + "']").attr("class") + " form-control"); $(this).attr("class", $("#" + $(this).attr("id") + " option[value='" + value + "']").attr("class") + " form-control");
choresOverviewTable.column(5).search(value).draw(); choresOverviewTable.column(choresOverviewTable.colReorder.transpose(5)).search(value).draw();
}); });
$("#user-filter").on("change", function() $("#user-filter").on("change", function()
@ -47,7 +47,7 @@ $("#user-filter").on("change", function()
// Transfer CSS classes of selected element to dropdown element (for background) // Transfer CSS classes of selected element to dropdown element (for background)
$(this).attr("class", $("#" + $(this).attr("id") + " option[value='" + value + "']").attr("class") + " form-control"); $(this).attr("class", $("#" + $(this).attr("id") + " option[value='" + value + "']").attr("class") + " form-control");
choresOverviewTable.column(6).search(value).draw(); choresOverviewTable.column(choresOverviewTable.colReorder.transpose(6)).search(value).draw();
if (!value.isEmpty()) if (!value.isEmpty())
{ {
@ -60,8 +60,8 @@ $("#clear-filter-button").on("click", function()
$("#search").val(""); $("#search").val("");
$("#status-filter").val("all"); $("#status-filter").val("all");
$("#user-filter").val("all"); $("#user-filter").val("all");
choresOverviewTable.column(5).search("").draw(); choresOverviewTable.column(choresOverviewTable.colReorder.transpose(5)).search("").draw();
choresOverviewTable.column(6).search("").draw(); choresOverviewTable.column(choresOverviewTable.colReorder.transpose(6)).search("").draw();
choresOverviewTable.search("").draw(); choresOverviewTable.search("").draw();
RemoveUriParam("user"); RemoveUriParam("user");
}); });

View File

@ -29,14 +29,14 @@ $("#product-group-filter").on("change", function()
value = ""; value = "";
} }
productsTable.column(6).search(value).draw(); productsTable.column(productsTable.colReorder.transpose(6)).search(value).draw();
}); });
$("#clear-filter-button").on("click", function() $("#clear-filter-button").on("click", function()
{ {
$("#search").val(""); $("#search").val("");
$("#product-group-filter").val("all"); $("#product-group-filter").val("all");
productsTable.column(6).search("").draw(); productsTable.column(productsTable.colReorder.transpose(6)).search("").draw();
productsTable.search("").draw(); productsTable.search("").draw();
if ($("#show-disabled").is(":checked") || $("#show-only-in-stock").is(":checked")) if ($("#show-disabled").is(":checked") || $("#show-only-in-stock").is(":checked"))
{ {

View File

@ -99,7 +99,7 @@ $("#status-filter").on("change", function()
value = ""; value = "";
} }
recipesTables.column(5).search(value).draw(); recipesTables.column(recipesTables.colReorder.transpose(5)).search(value).draw();
$('.recipe-gallery-item').removeClass('d-none'); $('.recipe-gallery-item').removeClass('d-none');
if (value !== "") if (value !== "")

View File

@ -65,7 +65,7 @@ $("#status-filter").on("change", function()
// Transfer CSS classes of selected element to dropdown element (for background) // Transfer CSS classes of selected element to dropdown element (for background)
$(this).attr("class", $("#" + $(this).attr("id") + " option[value='" + value + "']").attr("class") + " form-control"); $(this).attr("class", $("#" + $(this).attr("id") + " option[value='" + value + "']").attr("class") + " form-control");
shoppingListTable.column(4).search(value).draw(); shoppingListTable.column(shoppingListTable.colReorder.transpose(4)).search(value).draw();
}); });
$("#selected-shopping-list").on("change", function() $("#selected-shopping-list").on("change", function()

View File

@ -32,7 +32,7 @@ $("#transaction-type-filter").on("change", function()
text = ""; text = "";
} }
stockJournalTable.column(4).search(text).draw(); stockJournalTable.column(stockJournalTable.colReorder.transpose(4)).search(text).draw();
}); });
$("#location-filter").on("change", function() $("#location-filter").on("change", function()
@ -44,7 +44,7 @@ $("#location-filter").on("change", function()
text = ""; text = "";
} }
stockJournalTable.column(5).search(text).draw(); stockJournalTable.column(stockJournalTable.colReorder.transpose(5)).search(text).draw();
}); });
$("#user-filter").on("change", function() $("#user-filter").on("change", function()
@ -56,7 +56,7 @@ $("#user-filter").on("change", function()
text = ""; text = "";
} }
stockJournalTable.column(6).search(text).draw(); stockJournalTable.column(stockJournalTable.colReorder.transpose(6)).search(text).draw();
}); });
$("#daterange-filter").on("change", function() $("#daterange-filter").on("change", function()

View File

@ -14,11 +14,11 @@ $("#product-filter").on("change", function()
var text = $("#product-filter option:selected").text(); var text = $("#product-filter option:selected").text();
if (value === "all") if (value === "all")
{ {
journalSummaryTable.column(1).search("").draw(); journalSummaryTable.column(journalSummaryTable.colReorder.transpose(1)).search("").draw();
} }
else else
{ {
journalSummaryTable.column(1).search("^" + text + "$", true, false).draw(); journalSummaryTable.column(journalSummaryTable.colReorder.transpose(1)).search("^" + text + "$", true, false).draw();
} }
}); });
@ -31,7 +31,7 @@ $("#transaction-type-filter").on("change", function()
text = ""; text = "";
} }
journalSummaryTable.column(2).search(text).draw(); journalSummaryTable.column(journalSummaryTable.colReorder.transpose(2)).search(text).draw();
}); });
$("#user-filter").on("change", function() $("#user-filter").on("change", function()
@ -43,7 +43,7 @@ $("#user-filter").on("change", function()
text = ""; text = "";
} }
journalSummaryTable.column(3).search(text).draw(); journalSummaryTable.column(journalSummaryTable.colReorder.transpose(3)).search(text).draw();
}); });
$("#search").on("keyup", Delay(function() $("#search").on("keyup", Delay(function()
@ -64,8 +64,8 @@ $("#clear-filter-button").on("click", function()
$("#location-filter").val("all"); $("#location-filter").val("all");
$("#user-filter").val("all"); $("#user-filter").val("all");
$("#product-filter").val("all"); $("#product-filter").val("all");
journalSummaryTable.column(1).search("").draw(); journalSummaryTable.column(journalSummaryTable.colReorder.transpose(1)).search("").draw();
journalSummaryTable.column(2).search("").draw(); journalSummaryTable.column(journalSummaryTable.colReorder.transpose(2)).search("").draw();
journalSummaryTable.column(3).search("").draw(); journalSummaryTable.column(journalSummaryTable.colReorder.transpose(3)).search("").draw();
journalSummaryTable.search("").draw(); journalSummaryTable.search("").draw();
}); });

View File

@ -45,7 +45,7 @@ $("#location-filter").on("change", function()
value = "xx" + value + "xx"; value = "xx" + value + "xx";
} }
stockOverviewTable.column(6).search(value).draw(); stockOverviewTable.column(stockOverviewTable.colReorder.transpose(6)).search(value).draw();
}); });
$("#product-group-filter").on("change", function() $("#product-group-filter").on("change", function()
@ -60,7 +60,7 @@ $("#product-group-filter").on("change", function()
value = "xx" + value + "xx"; value = "xx" + value + "xx";
} }
stockOverviewTable.column(8).search(value).draw(); stockOverviewTable.column(stockOverviewTable.colReorder.transpose(8)).search(value).draw();
}); });
$("#status-filter").on("change", function() $("#status-filter").on("change", function()
@ -74,7 +74,7 @@ $("#status-filter").on("change", function()
// Transfer CSS classes of selected element to dropdown element (for background) // Transfer CSS classes of selected element to dropdown element (for background)
$(this).attr("class", $("#" + $(this).attr("id") + " option[value='" + value + "']").attr("class") + " form-control"); $(this).attr("class", $("#" + $(this).attr("id") + " option[value='" + value + "']").attr("class") + " form-control");
stockOverviewTable.column(7).search(value).draw(); stockOverviewTable.column(stockOverviewTable.colReorder.transpose(7)).search(value).draw();
}); });
$(".status-filter-message").on("click", function() $(".status-filter-message").on("click", function()
@ -90,9 +90,9 @@ $("#clear-filter-button").on("click", function()
$("#status-filter").val("all"); $("#status-filter").val("all");
$("#product-group-filter").val("all"); $("#product-group-filter").val("all");
$("#location-filter").val("all"); $("#location-filter").val("all");
stockOverviewTable.column(6).search("").draw(); stockOverviewTable.column(stockOverviewTable.colReorder.transpose(6)).search("").draw();
stockOverviewTable.column(7).search("").draw(); stockOverviewTable.column(stockOverviewTable.colReorder.transpose(7)).search("").draw();
stockOverviewTable.column(8).search("").draw(); stockOverviewTable.column(stockOverviewTable.colReorder.transpose(8)).search("").draw();
stockOverviewTable.search("").draw(); stockOverviewTable.search("").draw();
}); });

View File

@ -31,7 +31,7 @@ $("#status-filter").on("change", function()
// Transfer CSS classes of selected element to dropdown element (for background) // Transfer CSS classes of selected element to dropdown element (for background)
$(this).attr("class", $("#" + $(this).attr("id") + " option[value='" + value + "']").attr("class") + " form-control"); $(this).attr("class", $("#" + $(this).attr("id") + " option[value='" + value + "']").attr("class") + " form-control");
tasksTable.column(5).search(value).draw(); tasksTable.column(tasksTable.colReorder.transpose(5)).search(value).draw();
}); });
$("#clear-filter-button").on("click", function() $("#clear-filter-button").on("click", function()

View File

@ -27,7 +27,7 @@ $("#entity-filter").on("change", function()
value = ""; value = "";
} }
userfieldsTable.column(1).search(value).draw(); userfieldsTable.column(userfieldsTable.colReorder.transpose(1)).search(value).draw();
$("#new-userfield-button").attr("href", U("/userfield/new?embedded&entity=" + value)); $("#new-userfield-button").attr("href", U("/userfield/new?embedded&entity=" + value));
}); });
@ -35,7 +35,7 @@ $("#clear-filter-button").on("click", function()
{ {
$("#search").val(""); $("#search").val("");
$("#entity-filter").val("all"); $("#entity-filter").val("all");
userfieldsTable.column(1).search("").draw(); userfieldsTable.column(userfieldsTable.colReorder.transpose(1)).search("").draw();
userfieldsTable.search("").draw(); userfieldsTable.search("").draw();
}); });