Skip to content

Commit

Permalink
set initial table columns sort from saved view state on restore (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
RandomFractals committed Jan 10, 2022
1 parent 39fb5e8 commit f40adcd
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion web/scripts/tableView.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,17 @@ function createTableConfig(tableColumns) {
};

if (tableColumns && tableColumns.length > 0) {
// use restored table columns config
tableConfig.autoColumns = false;
tableConfig.columns = tableColumns;
}

const initialSort = viewState.tableConfig.sort;
if (initialSort) {
// set initial sort from restored table view state
tableConfig.initialSort = initialSort;
}

return tableConfig;
}

Expand Down Expand Up @@ -487,7 +495,6 @@ function saveTableSetting(id, type, data) {
// update table config in view state
tableConfig[type] = data;
vscode.setState(viewState);

// console.log(`tableView.saveTableSetting():viewState`, viewState);
}

Expand Down

0 comments on commit f40adcd

Please # to comment.