Export to CSV including all select options from drop down list as headers

Export to CSV including all select options from drop down list as headers

sonesaysonesay Posts: 1Questions: 1Answers: 0

Hi All,

I'm using Datatables multi select addon and the export to csv buttons. I get all the select options from the drop-down list being exported to the csv headers. This makes the csv headers very long and unreadable. Can I force export to csv to display the original header label and not the select options labels?

Answers

  • allanallan Posts: 63,818Questions: 1Answers: 10,517 Site admin

    The best thing to do would be to have a second row in your header in which you can put the select filter. The export will ignore that second row (use orderCellsTop to make it export the top row).

    The other option is to use a custom renderer for the header cells - see buttons.exportData().

    Allan

This discussion has been closed.