Is there a way toi hide a hidden value in the CSV file
Is there a way toi hide a hidden value in the CSV file
I have a download CSV button which is working and is currently not downloading certain columns (this is working fine and not the issue), the issue im having is, as I'm in the UK my date columns are in formatted as 'DD/MM/YYYY' and for the sorting to work correctly, i have a hidden span before my formatted date value which displays the date as 'YYYY/MM/DD' (again, this is working fine) BUT when i download as a CSV, it has both values in it so i was wondering if its possible to stop this
Example code
columns: [
{
data: null, width: '100px', title: 'Submitted',
render: function (data) {
return '<span class="date">' + data.created + '</span> ' + data.created_formatted
}
},
And the date in the CSV
,"2024/07/06 06/07/2024",
The '2024/07/06' is the hidden span, and I want to hide it in the CSV file if possible
Answers
Two options:
I'd say that since you have a rendering function, use the orthogonal approach - e.g.
Note that I've added checks for
typeandsortas well, which would allow the ordering in the table to work for the ISO detected date column.Allan