Table tools wont work with fnRowCallback
Table tools wont work with fnRowCallback
chandanbokaro
Posts: 4Questions: 0Answers: 0
I use fnRowCallback to calculate the serial number of the row. Just for display purpose.
[code]"fnRowCallback" : function(nRow, aData, iDisplayIndex){
var oSettings = oAllLinksTable.fnSettings();
$("td:first", nRow).html(oSettings._iDisplayStart+iDisplayIndex +1);
return nRow;[/code]
Now when i export the file pdf/excel/csv or copy to clipboard the calculated row is not exported or present in clipboard.
How to proceed with this.. Any Idea !
[code]
oAllLinksTable= $("#companies1").dataTable(
{
"sAjaxSource" : "/DTS/MultiskillServlet?screenCode=MasterData",
"aaSorting" : [],
"bDestroy" : true,
"bJQueryUI" : true,
"bStateSave": false,
"bRetrieve" : false,
"bProcessing" : true,
"iDisplayLength": 10,
"oLanguage": {
"sSearch": "Search all columns:"
},
"sPaginationType" : "full_numbers",
"sDom": 'T<"clear">lfrtip',
"fnRowCallback" : function(nRow, aData, iDisplayIndex){
var oSettings = oAllLinksTable.fnSettings();
$("td:first", nRow).html(oSettings._iDisplayStart+iDisplayIndex +1);
return nRow;
},
"aoColumns" :
[
{"mData":null},
{ "mData" : "stno",
"mRender": function ( o,val,data ) {
if(data.last_payment != '-')
return ''+o+'';
else
return o;
}},
{ "mData" : "name"},
{ "mData" : "grade"},
{ "mData" : "deptt"},
{ "mData" : "skill_accq"},
{ "mData" : "hrd_comp_date"},
{ "mData" : "util_end_date"},
{ "mData" : "last_payment"}
],
"oTableTools": {
"aButtons": [
"copy",
"csv",
"xls",
"pdf",
"print"
]
}
});
[/code]
[code]"fnRowCallback" : function(nRow, aData, iDisplayIndex){
var oSettings = oAllLinksTable.fnSettings();
$("td:first", nRow).html(oSettings._iDisplayStart+iDisplayIndex +1);
return nRow;[/code]
Now when i export the file pdf/excel/csv or copy to clipboard the calculated row is not exported or present in clipboard.
How to proceed with this.. Any Idea !
[code]
oAllLinksTable= $("#companies1").dataTable(
{
"sAjaxSource" : "/DTS/MultiskillServlet?screenCode=MasterData",
"aaSorting" : [],
"bDestroy" : true,
"bJQueryUI" : true,
"bStateSave": false,
"bRetrieve" : false,
"bProcessing" : true,
"iDisplayLength": 10,
"oLanguage": {
"sSearch": "Search all columns:"
},
"sPaginationType" : "full_numbers",
"sDom": 'T<"clear">lfrtip',
"fnRowCallback" : function(nRow, aData, iDisplayIndex){
var oSettings = oAllLinksTable.fnSettings();
$("td:first", nRow).html(oSettings._iDisplayStart+iDisplayIndex +1);
return nRow;
},
"aoColumns" :
[
{"mData":null},
{ "mData" : "stno",
"mRender": function ( o,val,data ) {
if(data.last_payment != '-')
return ''+o+'';
else
return o;
}},
{ "mData" : "name"},
{ "mData" : "grade"},
{ "mData" : "deptt"},
{ "mData" : "skill_accq"},
{ "mData" : "hrd_comp_date"},
{ "mData" : "util_end_date"},
{ "mData" : "last_payment"}
],
"oTableTools": {
"aButtons": [
"copy",
"csv",
"xls",
"pdf",
"print"
]
}
});
[/code]
This discussion has been closed.
Replies
Allan
"bDestroy" : false,