header problem and tools problem
header problem and tools problem
Hi alan/anyone
Problem1:
I tried searching for solutions but none worked for me. and i saw many of them faced the same problems.but since i am not very familiar with the coding of data tables and jquery i need help.
I am using jquery tabs and i have 2 tabs. the headers get are scrambled when i view the second tab table.when i click on the header it aligns properly. This is the code i use to initialise the second table
[code]
$(document).ready( function () {
$('#traddet').dataTable( {
"sScrollY": "400px",
"bPaginate": false,
"sDom": 'T<"clear">lfrtip',
"oTableTools": {
"sSwfPath": "copy_cvs_xls_pdf.swf",
// "aButtons": ["copy","xls",{"sExtends": "pdf","sPdfOrientation": "landscape" } ]
"aButtons": ["copy","xls" ]
}
} );
} );
//Code i used for tabs
$(function() {
$( "#tabs" ).tabs();
});
[/code]
Problem2:
The Copy or excel or pdf none works in the second tab. Only sorting and search works. Why is that so? In the first tab nothing is wrong.
Im so confused reading all the solutions.
Problem1:
I tried searching for solutions but none worked for me. and i saw many of them faced the same problems.but since i am not very familiar with the coding of data tables and jquery i need help.
I am using jquery tabs and i have 2 tabs. the headers get are scrambled when i view the second tab table.when i click on the header it aligns properly. This is the code i use to initialise the second table
[code]
$(document).ready( function () {
$('#traddet').dataTable( {
"sScrollY": "400px",
"bPaginate": false,
"sDom": 'T<"clear">lfrtip',
"oTableTools": {
"sSwfPath": "copy_cvs_xls_pdf.swf",
// "aButtons": ["copy","xls",{"sExtends": "pdf","sPdfOrientation": "landscape" } ]
"aButtons": ["copy","xls" ]
}
} );
} );
//Code i used for tabs
$(function() {
$( "#tabs" ).tabs();
});
[/code]
Problem2:
The Copy or excel or pdf none works in the second tab. Only sorting and search works. Why is that so? In the first tab nothing is wrong.
Im so confused reading all the solutions.
This discussion has been closed.
Replies
http://www.datatables.net/examples/api/tabs_and_scrolling.html
i tried the solution in this link
http://datatables.net/extras/tabletools/api#fnResizeButtons
and it worked for the second table everything...but now tabs dont work. both the tables are shown on the same page one below the other..
[code]
$("#tabs").tabs( {
"show": function(event, ui) {
var jqTable = $('table.display', ui.panel);
if ( jqTable.length > 0 ) {
var oTableTools = TableTools.fnGetInstance( jqTable[0] );
if ( oTableTools != null && oTableTools.fnResizeRequired() )
{
/* A resize of TableTools' buttons and DataTables' columns is only required on the
* first visible draw of the table
*/
jqTable.dataTable().fnAdjustColumnSizing();
oTableTools.fnResizeButtons();
}
}
}
} );
$(document).ready( function () {
$('#traddet').dataTable( {
"sScrollY": "400px",
"bPaginate": false,
"sDom": 'T<"clear">lfrtip',
"oTableTools": {
"sSwfPath": "copy_cvs_xls_pdf.swf",
// "aButtons": ["copy","xls",{"sExtends": "pdf","sPdfOrientation": "landscape" } ]
"aButtons": ["copy","xls" ]
}
} );
//oTable.fnAdjustColumnSizing();
} );
[/code]