jquery datatables row count across pages

前端 未结 5 2029
礼貌的吻别
礼貌的吻别 2021-02-18 13:50

I\'m using the jQuery DataTables plug-in for my HTML table.

Is there a way to get the row count of the number of rows in my table across pages.

For example, if I

5条回答
  •  不知归路
    2021-02-18 14:28

    When using server-side paging you can access the total record count like so...

    dt.fnSettings()._iRecordsTotal;
    

    If you're using server side paging, you could hook into the fnDrawCallback and update your html whenever the table is drawn...

    $('#Table').dataTable({
        "fnDrawCallback": function (oSettings) {
            alert(oSettings._iRecordsTotal);
         }
    });
    

提交回复
热议问题