jQuery Datatable分页行更新问题

时间:2018-12-03 09:14:02

标签: jquery jquery-ui datatables

我的jquery dataTable具有以下设置

var tobSearchResult = $('#TOBForm\\:tobSearchResult').DataTable({
 "pageLength": 5,
"lengthMenu" : [ [ 10, 25, 50 ], [ 10, 25, 50 ] ],
"language" : {
    "lengthMenu" : "Display _MENU_ reports per page",
    "search" : "Filter Reports:",
    "zeroRecords" : "No reports to display",
    "info" : "Showing _START_ to _END_ of _TOTAL_ reports",
    "infoEmpty" : "No Reports Found",
    "infoFiltered" : " - filtered from _MAX_ reports"
},
columnDefs : [ {
    orderable : false,
    targets : [ 0 ]
}
  ]}).order([ 4, 'desc' ]).draw();

页面加载时会按如下方式更新表的列(基本上更改类为.srLink的col的href)

$.each($('.srLink'),function(){
            $(this).attr("href", "<link to page>");
        });

如果有8条记录,那么将有2页,但是上面的代码仅更新第一页上的行。有什么办法可以更新吗 第二页上的行。为什么$ .each($('。srLink'),function()仅返回当前页面的行。

0 个答案:

没有答案
相关问题