Primeng: export the template data instead of the original data to csv

Created on 5 Sep 2016  路  5Comments  路  Source: primefaces/primeng

I use the below template to format the table cell, but when I export to csv, the csv data keep its original data, is it possible to export the template data to csv as this behaviour is not consistent between the look and the export.

     <p-column field="end_time" header="end_time">
        <template let-col let-row="rowData" pTemplate type="body">
          <span>{{row[col.field] | date:"HH:mm:ss"}}</span>
        </template>
      </p-column>

Most helpful comment

And export the header name instead the field's name

All 5 comments

I'd like this exact feature as well. Exporting dates to CSV is not human readable by default.

And export the header name instead the field's name

With 4.0.1 letting filters apply to CSV export, adding this would still be awesome

But we can't know what is inside templates so there is a technical limitation, will reopen if we can find a way.

Posted a working solution, which allows to export exactly what you see:
https://github.com/primefaces/primeng/issues/3552

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Faigjaz picture Faigjaz  路  3Comments

jisqaqov picture jisqaqov  路  3Comments

Helayxa picture Helayxa  路  3Comments

just-paja picture just-paja  路  3Comments

watalberto picture watalberto  路  3Comments