tabletools no working two tables

tabletools no working two tables

paradita85paradita85 Posts: 16Questions: 0Answers: 0
edited March 2013 in General
Hi I have two tables in different html. the code is as follows:

[code]
tablacliente = $('#tablacliente').dataTable( {
"bJQueryUI": true,
"sDom": '<"H"Tfr>t<"F"ip>',
"bPaginate": false,
"sScrollY": "300px",
"bScrollCollapse": true,
"oTableTools": {
"aButtons": [
{ "sExtends": "copy","bFooter": false, "sButtonText": "Copiar","mColumns": [0, 1, 2, 3, 4 ,5 , 6, 7]},
{ "sExtends": "csv", "bFooter": false, "sButtonText": "Csv", "mColumns": [0, 1, 2, 3, 4 ,5 , 6, 7]},
{ "sExtends": "pdf", "bFooter": false, "sButtonText": "Pdf", "sPdfOrientation": "landscape", "mColumns": [0, 1, 2, 3, 4 ,5, 6, 7]}
]
},
"aoColumns": [
null,
null,
null,
null,
{sWidth: '10%'},
null,
null,
null,
{ sWidth: '35%'}
],
"oLanguage": espanol
} )

tablalistaproductos = $('#tablalistaproductos').dataTable( {
"bJQueryUI": true,
"sDom": '<"H"Tfr>t<"F"ip>',
"bPaginate": false,
"sScrollY": "300px",
"bScrollCollapse": true,
"oTableTools": {
"aButtons": [
{ "sExtends": "copy","bFooter": false, "sButtonText": "Copiar","mColumns": [0, 1]},
{ "sExtends": "csv", "bFooter": false, "sButtonText": "Csv", "mColumns": [0,1]},
{ "sExtends": "pdf", "bFooter": false, "sButtonText": "Pdf", "sPdfOrientation": "landscape", "mColumns": [0, 1]}
]
},
"aoColumns": [null,null,null,{ "bVisible": false },null,null,null,{ "bVisible": false },null,null,null,{ "bVisible": false },{ "bVisible": false },null],
"oLanguage": espanol
})
var TableTools1 = TableTools.fnGetInstance( 'tablalistaproductos' );
if ( TableTools1 != null && TableTools1.fnResizeRequired() )
{
/* A resize of TableTools' buttons and DataTables' columns is only required on the
* first visible draw of the table
*/
tablalistaproductos.dataTable().fnAdjustColumnSizing();
TableTools1.fnResizeButtons();
}
[/code]
the first table works correctly but the second the buttons do not work TableTools

thanks.

Replies

  • allanallan Posts: 63,213Questions: 1Answers: 10,415 Site admin
    Please see: http://datatables.net/forums/discussion/12899/post-test-cases-when-asking-for-help-please-read and link to a test case showing the problem.

    Allan
This discussion has been closed.