Reload the table data every 30 seconds (paging retained):

Reload the table data every 30 seconds (paging retained):

IndiraDev26IndiraDev26 Posts: 4Questions: 3Answers: 0

Estoy cargando así mi tabla

<script>
var table;
$(document).ready(function(){

   var table = $('#mitabla').DataTable({
      "ajax":"../../includes/select/select_t_oficina.php",
        "columns":[
          { "data": "fechavisita"},
          { "data": "asunto"},
          { "data": "estatus"},
          { "data": "fechacompro"},
          { "data": "horacompro"}
        ],

      "destroy": true,
      "order": [[1, "desc"]],
      "language":{
      "lengthMenu": "Mostrar _MENU_ Registros por página",
      "info": "Mostrando pagina _PAGE_ de _PAGES_",
        "infoEmpty": "No hay registros disponibles",
        "infoFiltered": "(filtrada de _MAX_ registros)",
        "loadingRecords": "Cargando...",
        "processing":     "Procesando...",
        "search": "Buscar:",
        "zeroRecords":    "No se encontraron registros coincidentes",
        "paginate": {
          "next":       "Siguiente",
          "previous":   "Anterior"
        },          
      },   
    });
  });

</script>

¿Cómo la puedo recargar cada 10 segundos con la función reload()?

var table = $('#example').DataTable( {
ajax: "data.json"
} );

setInterval( function () {
table.ajax.reload( null, false ); // user paging is not reset on reload
}, 30000 );

Es la primera vez que uso DataTables

This question has an accepted answers - jump to answer

Answers

This discussion has been closed.