最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin1浏览0评论

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"]],
        });
 });
发布评论

评论列表(0)

  1. 暂无评论