Copy/CSV/Print buttons with input columns and special characters

Copy/CSV/Print buttons with input columns and special characters

msand01msand01 Posts: 54Questions: 24Answers: 1
edited September 2016 in Buttons

Regarding the buttons extension, is there a way, using a formatting function to export the table contents, to export both the content of input elements as well as standard DT cells - with the added monkey wrench that there can sometimes be special characters in some of the cells? Here is a test case of what I am referring to: http://live.datatables.net/leqonovo/2/edit
Currently when clicking the CSV button for example, a js error is thrown, when it encounters a cell with an = for example.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,452Questions: 1Answers: 10,055 Site admin
    Answer ✓

    Yes, you need to use the export function options for the buttons. This example shows how they can be used. In particular you would need to use the node parameter that is passed in, read the value from the input element directly and return it.

    Allan

  • msand01msand01 Posts: 54Questions: 24Answers: 1

    Thank you that really helped. I have an updated working version here: http://live.datatables.net/leqonovo/3/edit

This discussion has been closed.