File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
client/packages/lowcoder/src/comps/comps/tableComp Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -99,11 +99,15 @@ export class TableImplComp extends TableInitComp implements IContainer {
9999 }
100100
101101 downloadData ( fileName : string ) {
102+ // displayData already contains only visible columns (filtered in transformDispalyData)
103+ const displayData = ( this as any ) . exposingValues [ "displayData" ] ;
104+ const delimiter = this . children . toolbar . children . columnSeparator . getView ( ) ;
105+
102106 saveDataAsFile ( {
103- data : ( this as any ) . exposingValues [ " displayData" ] ,
107+ data : displayData ,
104108 filename : fileName ,
105109 fileType : "csv" ,
106- delimiter : this . children . toolbar . children . columnSeparator . getView ( ) ,
110+ delimiter,
107111 } ) ;
108112 }
109113
Original file line number Diff line number Diff line change @@ -209,7 +209,8 @@ export function transformDispalyData(
209209 return oriDisplayData . map ( ( row ) => {
210210 const transData = _ ( row )
211211 . omit ( OB_ROW_ORI_INDEX )
212- . mapKeys ( ( value , key ) => dataIndexTitleDict [ key ] || key )
212+ . pickBy ( ( value , key ) => key in dataIndexTitleDict ) // Only include columns in the dictionary
213+ . mapKeys ( ( value , key ) => dataIndexTitleDict [ key ] )
213214 . value ( ) ;
214215 if ( Array . isArray ( row [ COLUMN_CHILDREN_KEY ] ) ) {
215216 return {
You can’t perform that action at this time.
0 commit comments