Skip to content

Commit

Permalink
Fixed #445 - Download buttons broken with remote pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
tsv2013 committed Jun 26, 2024
1 parent 4997d6a commit 514122c
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions src/tables/tabulator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,17 +259,19 @@ export class Tabulator extends Table {
this._rows.push(tableRow);
};
private accessorDownload = (cellData: any, rowData: any, reason: string, _: any, columnComponent: any, rowComponent: any) => {
const columnDefinition = columnComponent.getDefinition();
const questionName = columnDefinition.field;
const column = this.columns.filter(col => col.name === questionName)[0];
if (!!column && rowComponent) {
const dataRow = this.data[rowComponent.getPosition()];
const dataCell = dataRow[questionName];
if (column.dataType === ColumnDataType.Image) {
return questionName;
}
if (column.dataType === ColumnDataType.FileLink && Array.isArray(dataCell)) {
return (dataCell || []).map(f => f.name).join(", ");
if(Array.isArray(this.data)) {
const columnDefinition = columnComponent.getDefinition();
const questionName = columnDefinition.field;
const column = this.columns.filter(col => col.name === questionName)[0];
if (!!column && rowComponent) {
const dataRow = this.data[rowComponent.getPosition()];
const dataCell = dataRow[questionName];
if (column.dataType === ColumnDataType.Image) {
return questionName;
}
if (column.dataType === ColumnDataType.FileLink && Array.isArray(dataCell)) {
return (dataCell || []).map(f => f.name).join(", ");
}
}
}
if (this.currentDownloadType === "csv" || this.currentDownloadType === "xlsx") {
Expand Down

0 comments on commit 514122c

Please sign in to comment.