2016-06-29 16 views
6

ho integrato jquerydatatable nel quadro di bootstrap e quando seleziono tutto è mostrare come questoMostrando NaN di NaN in jQuery bootstrap DataTable

Visualizzazione NaN di NaN di 7 voci.

Javascript

$(function() { 


    $('#example2').DataTable({ 
     "lengthMenu": [5, 10, 50, "All"] 
    }); 

}); 

risposta

5

Leggendo gli esempi here:

$('#example').DataTable({ 
    "lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]] 
}); 

Quindi, aggiungere due array, una con i valori e uno con i testi indicati.

(-1 sembra essere uguale a "Tutto" in questo caso).

2

Prova questo, il suo lavoro per me:

$(function() { 
    $('#example2').dataTable({ 
      "iDisplayLength": 10, 
      "lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]], 
     }); 
});