Estoy trabajando con Django y al usar data table me sale este error jquery.dataTables.js:4789 Uncaug

Estoy trabajando con Django y al usar data table me sale este error jquery.dataTables.js:4789 Uncaug

CarloslpCarloslp Posts: 1Questions: 1Answers: 0
   function cargaRegistroAprobacion() {
        $(document).ready(function() {
            var selected = [];
              var tabla= $('#tconferencia').DataTable({
                  pageLength: '25',
                  destroy: true,
                  autoWidth: false,
                  columnDefs:[
                      {targets:2,ordenable:true,width:'20%'},
                      {targets:4,ordenable:false,width: '20%'},
                    ],
                  select: {
                       style:    'os',
                       selector: 'td:first-child'
                   },
                   order: [[ 0, 'asc' ]],

                  language : {
                     paginate: {
                           first: " |< ",
                           previous: "Ant.",
                           next: "Sig.",
                           last: " >| "
                       },
                    emptyTable:          "No hay datos disponibles en la tabla.",
                    info:               "Del START al END de TOTAL ",
                    infoEmpty:       "Mostrando 0 registros de un total de 0.",
                    infoFiltered:        "(filtrados de un total de MAX registros)",
                    infoPostFix:         "(actualizados)",
                    lengthMenu:          "Mostrar _MENU_ registros",
                    loadingRecords:       "Cargando...",
                    searchPlaceholder:    "Buscar ",
                    zeroRecords:         "No se han encontrado coincidencias.",
                    search:             "Buscar:" ,
                    processing: "Procesando la información",
                    select: {
                    rows: "%d Registros Seleccionados"
                       }
                  },

                    "scrollY": "500px",
                   "ajax" : {
                    "url" : "/listaAcceso",
                    "dataSrc" : "data",
                    "type" : "GET",
                    "dataType":'json',
                   "serverSide": true,
                    "contentType":"application/json",
                    rowCallback: function( row, data ) {
                    if ( $.inArray(data.DT_RowId, selected) !== -1 ) {
                        alert('hola');
                        $(row).addClass('selected');

                        }
                    }
                 },
                 "columns": [
                        {"data": "id"},
                        {"data": "nombres",},
                        {"data": "apellidos"},
                        {"data": "persona_visita"},
                        {"data": "asunto","width": "20%"},
                        {"data": "dependencia"}
                        ]
               } );
       } );

}

y mi HTML

Id Nombre Apellido Visita Asunto Dependencia/Empresa

Answers

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

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

This discussion has been closed.