Skip to content

Commit 57cd7dd

Browse files
committed
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
1 parent 42fa9cd commit 57cd7dd

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/pat/structure/js/views/table.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,14 @@ export default BaseView.extend({
7878
// Ignore first column and the last one (activeColumns.length + 1)
7979
// Do not show paginator, search or information, we only want column sorting
8080
const datatables_options = {
81-
order: [0, "asc"],
81+
// Don't apply initial ordering.
82+
order: [],
8283
columnDefs: [
8384
{
85+
// The first (selection checkboxes) and last (actions)
86+
// columns should not be sortable.
8487
orderable: false,
85-
targets: [0, this.app.activeColumns.length + 1],
88+
targets: [0, this.app.activeColumns.length + 2],
8689
},
8790
],
8891
paging: false,

0 commit comments

Comments
 (0)