Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion assets/controllers/elements/datatables/datatables_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,16 @@ export default class extends Controller {
return null;
}

//The saved order index is visual (post-reorder). If colReorder state
//exists, map it back to the original column index so the server sorts
//the correct column. colReorder[visualIndex] == originalIndex.
let columnIndex = order[0];
if (saved_state.colReorder) {
columnIndex = saved_state.colReorder[columnIndex];
}

return {
column: order[0],
column: columnIndex,
dir: order[1]
}
});
Expand Down
Loading