jquery-datatables-checkboxes
jquery-datatables-checkboxes copied to clipboard
Problems Clearing Table and Updating New Data
problems when updating the table and loading other data I am updating the fields, I destroy the table and it does not let me collect the data I have selected I get an error
my code is as follows
ajax.detalleFactura(datos, {
callback: function (data) {
$('#tablaColaboradores').DataTable().destroy();
if (data != null) {
console.log("datosFactura:", data);
datosFactura = data;
listadoConceptoFactura = data.listadoHomologado;
tablaLiqui = $('#tablaColaboradores').DataTable({
data: listadoConceptoFactura,
columnDefs: [
{
targets: 0,
checkboxes: {
seletRow: true
}
}
],
select: {
style: 'multi'
},
order: [[1, 'asc']],
columns: [
{data: "consecutivo"},
{data: "descripcionConceptoOTipoPrueba"},
{data: "tipoConceptoFacturar"},
{data: "valor"},
{data: "descuento"},
{data: "periodoNominal"}
]
});
$("#tabla_2").show();
} else {
$("#tabla_2").hide();
notificacion("Error", "No trae datos", "error");
}
},
timeout: 200000
});
I collect the selected data as follows
var seleccionados = tablaLiqui.column(0).checkboxes.selected();
and I keep getting the error again and again