JS代码如下:
$
.get("/terminal_get_all_app/",
function (cur_data
) {
table
= $('#terminal_datatables').DataTable({
responsive
: true,
data
: eval(cur_data
),
paging
: true,
ordering
: true,
order
: [[ 0, 'desc' ]],
searching
: true,
processing
: true,
language
: {
lengthMenu
: '<select class="form-control input-xsmall">' + '<option value="10">10</option>' + '<option value="20">20</option>' + '<option value="50">50</option>' + '<option value="100">100</option>' + '</select> 条记录',
search
: '<span >搜索:</span>',
paginate
: {
previous
: "上一页",
next
: "下一页",
first
: "首页",
last
: "末页"
},
zeroRecords
: "没有内容",
info
: "显示 _START_ 到 _END_ 条,共 _TOTAL_ 条",
infoEmpty
: "0条记录",
infoFiltered
: ""
},
pagingType
: "first_last_numbers",
fnRowCallback
: RowCallBack
,
});
});
function RowCallBack(nRow
, data
, iDisplayIndex
, iDisplayIndexFull
) {
if (data
[6].indexOf("异常") != -1)
{
$(nRow
).css("background", "#FFB6C1");
$('td', nRow
).eq(6).css('font-weight', "bold").css("color", "red");
}
}
效果图如下:
转载请注明原文地址: https://lol.8miu.com/read-21949.html