小编cjj*_*k88的帖子

JQuery Datatables 行索引未显示相应页面

我正在使用Jquery 数据表来构建一个表。我需要为我拥有的每一行提供一个行索引。但是当我切换到下一页时,行索引重置为 1。我需要行索引从第一页最后一行继续,意味着如果我的页面大小是 10,那么第二页第一行应该以 11 而不是 1 开头。我的问题与此图像SAMPLE相同。请帮我检查一下我的代码有什么问题。多谢 :)

var oTable = $('#myDataTable').dataTable({
                "bServerSide": true,
                "bJQueryUI": true,
                "bProcessing": true,
                "sAjaxSource": sAjaxPage.toString(),
                "sPaginationType": "full_numbers",
                "fnRowCallback": function (nRow, aData, iDisplayIndex, iDisplayIndexFull) {
                    debugger;
                    var index = iDisplayIndexFull + 1;
                    $("td:first", nRow).html(index);
                    return nRow;
                },
      "fnServerParams": function (aoData) {
                    aoData.push({ "name": "pTransactionDateFrom", "value": pTransactionDateFrom });
                    aoData.push({ "name": "pTransactionDateTo", "value": pTransactionDateTo });
                    aoData.push({ "name": "pTransactionNo", "value": pTransactionNo });
                },
                "aoColumns": [
                        {
                            "bSort": false,
                            "bSearchable": false,
                            "bSortable": false,
                            "bFilter": false …
Run Code Online (Sandbox Code Playgroud)

indexing jquery row datatables

3
推荐指数
1
解决办法
3364
查看次数

标签 统计

datatables ×1

indexing ×1

jquery ×1

row ×1