Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Showing NaN to NaN in jquery bootstrap datatable

I have integrated jquerydatatable in bootstrap framework and when i select All it is showing like this

Showing NaN to NaN of 7 entries.

Javascript

$(function () {


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

});
like image 281
Raj Avatar asked Jun 29 '16 06:06

Raj


2 Answers

Reading the examples here:

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

So, add two arrays, one with values and one with the texts shown.

(-1 seem to be equal to "All" in this case).

like image 154
Arg0n Avatar answered Nov 08 '22 15:11

Arg0n


Try this, its working for me:

$(function () {
    $('#example2').dataTable({
            "iDisplayLength": 10,
            "lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],
        });
 });
like image 31
Govind Samrow Avatar answered Nov 08 '22 15:11

Govind Samrow