Include a button to the export files
Include a button to the export files
Hello, I have developed the datatables, and I'm using tabletools to generate xls and csv files. But in my table one of the columns is a button how can I display the data of this button inside the xls or csv files? (When I do the exports, this column appears to be empty, obviously is null).
Thanks
Thanks
This discussion has been closed.
Replies
Allan
"fnCellRender": function ( sValue, iColumn, nTr, iDataIndex ) {
var valueExport = "";
var data = $(sValue)[0];
var tag = data.tagName;
if(iColumn == 1){
valueExport = data.getAttribute("value");
}
return valueExport;
}
But it doesn't work at all =(
The problem was in my fnCellRender function, this is my code (that works):
Code:
"mColumns": [ 0, 1, 2 ],
"fnCellRender": function ( sValue, iColumn, nTr, iDataIndex ) {
if(iColumn == 0){
var data = $(sValue)[0];
var valueExport = data.getAttribute("value");
return valueExport;
}else if(iColumn == 3){
return 0;
}
return sValue;
}
Enjoy ;)
Allan