When try reorder column in my datatable with 10500 rows has a delay of 10 seconds aprox.

When try reorder column in my datatable with 10500 rows has a delay of 10 seconds aprox.

frankct2030frankct2030 Posts: 1Questions: 1Answers: 0

Before I made it instantaneous, I do not see what I can be doing wrong.

            /**********************************************************************************/
            $('#' + idTabla + '').DataTable({
                processing: true,
                serverSide: false,
                order: [0, 'desc'],
                paging: true,
                language: lenguajePorDefectoEnGrilla,
                data: response,
                columns: nombreColumnas,                                
                dom: 'Rlfrtip',
                colReorder: { realtime: true },


                "columnDefs": [
                    {
                        "render": function (data, type, row) {
                            return ("<span class='linkAProceso' onclick= 'irAVentanaProceso(" + +data + ")'>" + data + "</span>");
                        },
                        "width": "30px",
                        "targets": 0
                    },   
                    {
                        "render": function (data, type, row) {                                                           
                            return ("<span class='" + data.toLowerCase() + "'>" + data + "</span>");                               
                        },
                        "width": "30px",
                        "targets": 1
                    },                                          
                    {                           
                        "visible": false,
                        "searchable": false,
                        "targets": 2
                    }                        

                ],

                //TODO: 
                //scrollY: "75vh",
                //scrollX: true,
                //scrollCollapse: true,                    
                //fixedColumns: true ,// {leftColumns: 2 },        
                //--------------------------------------------------------------------------------------------------
                "initComplete": function (settings, json) {

                    //Se inicializa la grilla luego de que termine de cargar el ajax, para que habilite todos sus Rows    

                    //#region  SetearEncabezadoExportar
                    let documentoElegido = ComboBox_DevolverItemsSeleccionados("cmbDocumentoProcesos");
                    let nombreDocumento;
                    if (documentoElegido.length) { nombreDocumento = documentoElegido[0].innerText; }
                    let subtitulo = "Documento/Proceso: " + nombreDocumento + "\t\t\t Fecha desde: " + fechaDesde + "\t\t\t Fecha hasta: " + fechaHasta;
                    Grilla_SetearEncabezadoParaExportar(idTabla, "Datos de Procesos", subtitulo, null, 'landscape');
                    //#endregion 

                    CargarGrilla2(idTabla, "Español", "True", "True", "True", "True", "False", "", "True", lenguajePorDefectoEnGrilla, null, true);
                    DataTableDatosProcesos = $('#' + idTabla + '').DataTable();

                    var tablaVacia = $('#' + idTabla + '').find('.dataTables_empty');
                    if (tablaVacia.length == 1) { tablaVacia[0].innerText = "No se encontraron datos para el criterio de busqueda. " }                       

                },

                "rowCallback": function (nRow, data, iDisplayIndex) {
                    $(nRow).on('mousedown', function (e) {
                        if (e.button == 2) {
                            return false;                                
                        }
                        return true;
                    });
                }

            });


    });

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @frankct2030 ,

    There's nothing obvious wrong there - do you see any errors or is it just running slow?
    See this example here - it has most of your settings and is sluggish but still less than a second. Could you modify that example to show the problem please.

    Cheers,

    Colin

This discussion has been closed.