Is there any way to export tabulator data to CSV using formatting,
I am using Vue tabulator, Exporting is working fine but it does not include formatted data.
Exports specifically only include unformatted table data because a lot of formatters include HTML elements that add graphical component to the cells that would not make sense in downloaded file (progress bars for example).
That being said if you would like to transform data as it is being exported, you could look at using an accessor, these are used to transform data as it is leaving the table. in this case we will need to use an accessorDownload accessor.
For the sake of example, lets assume we are doing this to the name column and want to prefix the word "mr " to the beginning of every value;
We would star by defining our accessor function:
function mrAccessor(value, data, type, component, row){
return "mr " + value; //prepend string to value
}
Then in our column definition we would assign the accessor to the column:
{title:"Name", field:"name", accessorDownload:mrAccessor},
The data that is exported with the include the changed name values, but the values in the Tabulator table itself will remain unaffected
For full details, have a look at the Accessor Documentation