Fixed Columns and TableTools
Fixed Columns and TableTools
ober0330
Posts: 5Questions: 0Answers: 0
First of all, Datatables is AWESOME! :-)
Now the problem. I'm using DataTables 1.9.4, FixedColumns 2.0.3, and as far as I know the latest version of TableTools. I have a table with 2 rows in the element of the table and the display of the table works great. However, I need to be able to use the TableTools Excel/CSV functionality to get all the data plus both header rows out. The default TableTools doesn't pull both rows so I found this hack:
http://stackoverflow.com/questions/7660683/tabletools-only-exporting-single-header-row
At first it wasn't working but then I disabled the FixedColumn stuff and BAM, works like a dream with the hack in place now.
So now I'm faced with a table that doesn't have fixed columns or a table that doesn't export all the header rows. Is there any way to resolve this? Obviously it's a conflict between TableTools and FixedColumns, but I don't know where to begin fixing it.
The application is behind security so I can't link to it. Here is my header definition with the fixed header stuff commented out:
[code]
<!---->
.ellip {
max-width: 100px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.page {
margin-top: 50px;
}
.sorting,
.sorting_desc,
.sorting_asc {
background: none !important;
}
$(function() {
var oTable = $('#dtable').dataTable({
"sScrollX": "100%",
//"sScrollXInner": "150%",
"bScrollCollapse": true,
"bPaginate": true,
"sPaginationType": "full_numbers",
"aaSorting": [[2,'asc'], [3,'asc']],
"bStateSave": false,
"oLanguage": {
"sSearch": "Search all columns:",
"sLengthMenu": 'Display '+
'20'+
'30'+
'40'+
'50'+
'100'+
'All'+
' records'
},
"aoColumnDefs": [
{ "sClass": "right", "aTargets": [ 10,11,12,13,14,15,16,17,18,19,20,21,22 ] },
{ "sType": "formatted-num", "aTargets": [ 10,11,12,13,14,15,16,17,18,19,20,21,22 ] }
],
"iDisplayLength": 20,
"sDom": 'T<"clear">lfrtip',
"oTableTools": {
"sSwfPath": "<?=$env?>js/datatables/extras/TableTools/media/swf/copy_csv_xls_pdf.swf"
}
});
/*new FixedColumns( oTable, {
"iLeftColumns": 1
});*/
});
[/code]
Now the problem. I'm using DataTables 1.9.4, FixedColumns 2.0.3, and as far as I know the latest version of TableTools. I have a table with 2 rows in the element of the table and the display of the table works great. However, I need to be able to use the TableTools Excel/CSV functionality to get all the data plus both header rows out. The default TableTools doesn't pull both rows so I found this hack:
http://stackoverflow.com/questions/7660683/tabletools-only-exporting-single-header-row
At first it wasn't working but then I disabled the FixedColumn stuff and BAM, works like a dream with the hack in place now.
So now I'm faced with a table that doesn't have fixed columns or a table that doesn't export all the header rows. Is there any way to resolve this? Obviously it's a conflict between TableTools and FixedColumns, but I don't know where to begin fixing it.
The application is behind security so I can't link to it. Here is my header definition with the fixed header stuff commented out:
[code]
<!---->
.ellip {
max-width: 100px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.page {
margin-top: 50px;
}
.sorting,
.sorting_desc,
.sorting_asc {
background: none !important;
}
$(function() {
var oTable = $('#dtable').dataTable({
"sScrollX": "100%",
//"sScrollXInner": "150%",
"bScrollCollapse": true,
"bPaginate": true,
"sPaginationType": "full_numbers",
"aaSorting": [[2,'asc'], [3,'asc']],
"bStateSave": false,
"oLanguage": {
"sSearch": "Search all columns:",
"sLengthMenu": 'Display '+
'20'+
'30'+
'40'+
'50'+
'100'+
'All'+
' records'
},
"aoColumnDefs": [
{ "sClass": "right", "aTargets": [ 10,11,12,13,14,15,16,17,18,19,20,21,22 ] },
{ "sType": "formatted-num", "aTargets": [ 10,11,12,13,14,15,16,17,18,19,20,21,22 ] }
],
"iDisplayLength": 20,
"sDom": 'T<"clear">lfrtip',
"oTableTools": {
"sSwfPath": "<?=$env?>js/datatables/extras/TableTools/media/swf/copy_csv_xls_pdf.swf"
}
});
/*new FixedColumns( oTable, {
"iLeftColumns": 1
});*/
});
[/code]
This discussion has been closed.
Replies
Allan
This still doesn't address the issue that the Frozen Column modification seems to be causing an issue when I can get TableTools to spit out both header rows.