Datatables column have toggle icons. How can i perform export to excel with values like 1 or 0.
Datatables column have toggle icons. How can i perform export to excel with values like 1 or 0.

I am using datatables wherein status icon is used. I want to get values in export to excel as 1 and 0. Currently, it is showing as blank values.
How can i customize ?
This question has accepted answers - jump to:
This discussion has been closed.
Answers
Your code will need to update the data for that column with the values of 1 or 0. Similar to what the
rowCallback
function is doing in this example. Are you doing something like this?Kevin
It is basically custom icons. What I want is during excel export, values should appear based on it.
Above one is also correct, but how to perform the same during excel export. ?
Like I said you need to update the Datatables data to have the values of 1 or 0 depending on the position of the toggle. Please build a simple test case showing what you have then we can help you get this going.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
I have achieved this with the below code. You have rightly guided me.
Thanks Kevin for your help.
Glad you got it working but that is not exactly what I had in mind. Here is an example of what I meant:
http://live.datatables.net/muxexejo/1/edit
To add to my above comment this solution also needs to use orthogonal data for the export as shown in this example. Just showing this example for others that might find this thread. If your solution works for you please continue to use it.
Kevin