Skip to content

Problems Clearing Table and Updating New Data #84

Description

@Screnhack

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions