Author Topic: Messy code when exporting to csv file  (Read 1801 times)

derbySoft

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 9
    • View Profile
Messy code when exporting to csv file
« on: February 14, 2017, 01:34:29 pm »
We are having some problem when exporting table content to csv. In the content, there are some special characters such as '∞'. There is no problem for the excel format but it turns to messy code in csv file.

Is there a way to fix it or a workaround to override the content? Thanks.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6263
    • View Profile
Re: Messy code when exporting to csv file
« Reply #1 on: February 14, 2017, 05:47:00 pm »
The cell content can be overridden while export in column.render callback and use of properties column.exportRender and passing render: true to exportData() method.

Code: [Select]
column.render = function(ui){
  if(ui.Export){ //true while export.
     return "custom value";
  }
}

https://paramquery.com/pro/api#option-column-render

https://paramquery.com/pro/api#option-column-exportRender

https://paramquery.com/pro/api#method-exportData