jquery-datatables-checkboxes icon indicating copy to clipboard operation
jquery-datatables-checkboxes copied to clipboard

Problems Clearing Table and Updating New Data

Open Screnhack opened this issue 6 years ago • 0 comments

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 captura de pantalla de 2018-11-20 14-37-51

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

Screnhack avatar Nov 20 '18 19:11 Screnhack