From 57cd7ddc88835f88525cbac0a7d7f692eaf8c2b3 Mon Sep 17 00:00:00 2001 From: Johannes Raggam Date: Mon, 9 Mar 2026 22:21:10 +0100 Subject: [PATCH] fix(pat-structure): Fix ordering logic. The logic to set orderable columns in the structure pattern was quite wrong: - The very first and second-to-last columns were set to no ordering. This PR fixes it to the very first (selection checkboxes) and very last column (actions column). - The very first column was set for a default, ascending ordering. This went unnoticed, as the checkbox cells all have the same order information. This PR sets no initial ordering, as we want the order position in the container set as the default ordering. Fixes: #1551 --- src/pat/structure/js/views/table.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pat/structure/js/views/table.js b/src/pat/structure/js/views/table.js index 2ec64ec7a0..4fbdeaefc9 100644 --- a/src/pat/structure/js/views/table.js +++ b/src/pat/structure/js/views/table.js @@ -78,11 +78,14 @@ export default BaseView.extend({ // Ignore first column and the last one (activeColumns.length + 1) // Do not show paginator, search or information, we only want column sorting const datatables_options = { - order: [0, "asc"], + // Don't apply initial ordering. + order: [], columnDefs: [ { + // The first (selection checkboxes) and last (actions) + // columns should not be sortable. orderable: false, - targets: [0, this.app.activeColumns.length + 1], + targets: [0, this.app.activeColumns.length + 2], }, ], paging: false,