Use data attribute for export possible?
Use data attribute for export possible?
kevlin79
Posts: 3Questions: 1Answers: 0
Hi! Gave gone through the different ways to change the format of the data in a table before exporting to for instance excel. I apply datable to a generated table and use the data-order and data-search for ordering/searching. Is there a way to use the data-search data as exported data instead of the data <td> tag?
Thanks Kevin
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Found an old thread and built the code below. However can't get it to work, any ideas? It is called correctly by the buttons
When I change skip the if and always set data as "data = $(sel).data('search');" the excel is empty ... is the var sel correctly built?
will use the search data for all columns - which might or might not be what you want.
Or if you want more control, using a formatting function:
Allan
Aa wonderful, thanks!