Large Dataset 100 000 rows

Large Dataset 100 000 rows

rrzavaletarrzavaleta Posts: 78Questions: 52Answers: 2

Hi.

I am currently working with datatable using queries that exceed 20,000 rows.
However on occasions this result can be doubled.
Once the database resolves, do not arm the datatable, even though it exceeds the ajax timeout time by more than one minute.

What are the recommendations that I have to include in JavaScript / Jquery. For handling a long data set?
Then I leave an example of my ajax call with datatable ...

function createTableConsultarResponsablePeriodos( vlObjAnioPeriodo, vlObjetoDataTable, vlObjetodialogDinamico,
vlBuscadorPrincipal) {

    mostrarCargando();
    var vlObjetoRespuesta = vlObjetoDataTable.DataTable({
        "bDestroy": true,
       "scrollX": true,
        "processing": true,
          "dom": 'Bfrtip', "buttons": [
        {
            "extend": 'excel',
            "text": 'Exportar a Excel',
            "filename": 'RepRegulatorios' 
        }
    ],   
        ajax: {
            "type": "POST",
            "url": "consultarresponsableperiodos",
            data: {
                "pinanioperiodo": vlObjAnioPeriodo.val()        //vlObjAnioPeriodo.val(),

            }, error: function (jqXHR, textStatus) {
                ReiniciaSession(jqXHR);
                if (textStatus === 'timeout')
                {
                    var texto = "Se ha excedido el tiempo de la consulta<br>";
                    texto += "Intente nuevamente";
                    MensajePantallaError(texto, false, 0);
                }

            },
            timeout: tamanodeltimeoutajaxdatatables()
        },
        "language": lenguajespanishBGDT(),
        "columns": GetColumnasConsultarResponsablePeriodos(vlBuscadorPrincipal),
        "displayLength": 20,
         "order": [[ 2, 'asc' ]],
         "drawCallback": function ( settings ) {
                                                    var api = this.api();
                                                    var rows = api.rows( {page:'current'} ).nodes();
                                                    var last=null;

                                                    api.column(2, {page:'current'} ).data().each( function ( group, i ) {
                                                        if ( last !== group ) {
                                                            $(rows).eq( i ).before(
                                                                '<tr class="group"><td class="group" colspan="16">'+group+'</td></tr>'
                                                            );
                                                            last = group;
                                                        }
                                                    } );
                                                },
        "initComplete": function (settings, json) {
            quitarCargando();

        }
    });
    if (vlObjetodialogDinamico !== null) {
        ConstruyeObjetoDialogo(vlObjetodialogDinamico, "Tabla de Reportes Regulatorios", "", "");
    }
    return vlObjetoRespuesta;

}

Answers

This discussion has been closed.