Hi,
I have a DataTable with body props, when exportCSV is used these cells appear as undefined? Is there an answer to this?
Regards
DataTable exportCSV when column has body prop
Hi,
We tried in datatable-templating page like;
but we didnt see your issue ? Please, could you send your code or create an example like this https://codesandbox.io/s/0v8v2znl0 ?
We tried in datatable-templating page like;
Code: Select all
<DataTable value={this.state.cars} header={header} footer={footer} ref={(el) => { this.dt = el; }}>
<Column field="vin" header="Vin" />
<Column field="year" header="Year" />
<Column field="brand" header="Brand" body={this.brandTemplate} style={{textAlign:'center'}}/>
<Column field="color" header="Color" body={this.colorTemplate} />
<Column body={this.actionTemplate} style={{textAlign:'center', width: '8em'}}/>
</DataTable>
Is this issue resolved? I have the same issue. I use body prop to format the data in a column. When I try to use exportCSV on datatable, the format is not preserved. As a result, the csv file shows [object] in these columns. I am wondering if there is a way to format data before using exportCSV. Thanks!
-
- Information
-
Who is online
Users browsing this forum: No registered users and 21 guests