tabletools no working two tables
tabletools no working two tables
paradita85
Posts: 16Questions: 0Answers: 0
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.
[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.
This discussion has been closed.
Replies
Allan