javascript - Showing NaN to NaN in jquery bootstrap datatable - Stack Overflow

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

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"]
    });

});

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"]
    });

});
Share Improve this question edited Jun 29, 2016 at 15:14 halfer 20.4k19 gold badges109 silver badges202 bronze badges asked Jun 29, 2016 at 6:35 RajRaj 8791 gold badge10 silver badges23 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 5

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).

Try this, its working for me:

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

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745307390a4621793.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信