Skip to content
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,15 @@ export class TableImplComp extends TableInitComp implements IContainer {
}

downloadData(fileName: string) {
// displayData already contains only visible columns (filtered in transformDispalyData)
const displayData = (this as any).exposingValues["displayData"];
const delimiter = this.children.toolbar.children.columnSeparator.getView();

saveDataAsFile({
data: (this as any).exposingValues["displayData"],
data: displayData,
filename: fileName,
fileType: "csv",
delimiter: this.children.toolbar.children.columnSeparator.getView(),
delimiter,
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,8 @@ export function transformDispalyData(
return oriDisplayData.map((row) => {
const transData = _(row)
.omit(OB_ROW_ORI_INDEX)
.mapKeys((value, key) => dataIndexTitleDict[key] || key)
.pickBy((value, key) => key in dataIndexTitleDict) // Only include columns in the dictionary
.mapKeys((value, key) => dataIndexTitleDict[key])
.value();
if (Array.isArray(row[COLUMN_CHILDREN_KEY])) {
return {
Expand Down
Loading