Skip to content

Commit f850e56

Browse files
Merge pull request #1753 from rocket-admin/fix-column-order
fix column ordering
2 parents 6a0fb7d + fd21299 commit f850e56

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

frontend/src/app/components/dashboard/db-table-view/db-table-view.component.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -815,9 +815,15 @@ export class DbTableViewComponent implements OnInit, OnChanges {
815815
// Force Angular to detect changes and re-render the table immediately
816816
this.cdr.detectChanges();
817817

818+
// Send selected columns first, then non-selected at the end
819+
const orderedColumns = [
820+
...this.tableData.columns.filter((col) => col.selected),
821+
...this.tableData.columns.filter((col) => !col.selected),
822+
];
823+
818824
this._tables
819825
.updatePersonalTableViewSettings(this.connectionID, this.name, {
820-
list_fields: this.tableData.columns.map((col) => col.title),
826+
list_fields: orderedColumns.map((col) => col.title),
821827
})
822828
.subscribe({
823829
next: () => {

0 commit comments

Comments
 (0)