我无法打印数据表行编号

问题描述 投票:0回答:0

这里是我的 javascript 代码:

$(document).ready(function() {
   var t = $('#xin_table').dataTable({
        "columnDefs": [{
            "searchable": false,
            "orderable": false,
            "targets": 0
        }],
        "order": [[1, 'asc']],      
        "bDestroy": true,
        "ajax": {
            url : site_url+"reports/reports_assets_list/0/0/0/",
            type : 'GET'            
        },      
        dom: 'LBfrtip',
        "fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
            $('td:eq(0)', nRow).html(iDisplayIndexFull +1);
            $('[data-toggle="tooltip"]').tooltip()
        },  
        "buttons": ['csv', 'excel', 'pdf', 'print'], 
    });

需要帮助如何打印数据表中的行编号。如果我点击打印或 pdf,行编号将消失。

pdf printing datatables row
© www.soinside.com 2019 - 2024. All rights reserved.