I have two datatables on the same page but I need them to initialize them in a separate way since both are different: ONLY the first table has to have a function the second one can't. This is why I cannot initialize them together.I know that if I use the same class for both it works but my second table would have the same function the first table has and I don't want that.
Is there a way to initialize them in a sepate way?
this is what I tried using the tables' ID:
$('#dtBasicExample').DataTable({
"pageLength": 5,
"scrollX": true,
"ordering": false,
"paging": true,
"search": true,
"info": true,
"language":{
"lengthMenu": "Mostrar _MENU_ registros por pagina",
"info": "Mostrando pagina _PAGE_ de _PAGES_",
"infoEmpty": "No hay registros disponibles",
"infoFiltered": "(filtrada de _MAX_ registros)",
"loadingRecords": "Cargando...",
"processing": "Procesando...",
"search": "Buscar:",
"zeroRecords": "No se encontraron registros coincidentes",
"paginate": {
"next": "Siguiente",
"previous": "Anterior"
},
},
//ONLY the first table has to have this function.
//This is why I cannot initialize them together
"fnDrawCallback": function( oSettings ) {
var Clientes = $('#dtBasicExample').DataTable();
Clientes
.rows( '.selected' )
.nodes()
.to$()
.removeClass( 'selected' );
var Documentos = $('#dtDetalleEstadoCuenta').DataTable();
Documentos.clear();
Documentos.draw();
}
});
$('#dtDetalleEstadoCuenta').DataTable({
"pageLength": 5,
"scrollX": true,
"ordering": false,
"paging": true,
"search": true,
"info": true,
"language":{
"lengthMenu": "Mostrar _MENU_ registros por pagina",
"info": "Mostrando pagina _PAGE_ de _PAGES_",
"infoEmpty": "No hay registros disponibles",
"infoFiltered": "(filtrada de _MAX_ registros)",
"loadingRecords": "Cargando...",
"processing": "Procesando...",
"search": "Buscar:",
"zeroRecords": "No se encontraron registros coincidentes",
"paginate": {
"next": "Siguiente",
"previous": "Anterior"
},
}
});