我从SQL过程中检索了包含要在该特定行上应用的类名称的列.
但是,该表作为数据源传递给datatable.js.现在使用我的代码,指定的类只应用于一个单元格:in fnRowCallback()function.我想要将该类应用于整行.
javascript代码:var dataSet = JSON.parse("[" + a.toString() + "]")
$(document).ready(function () {
$('#demo').html('<table cellpadding="0" cellspacing="0" border="0" class="display" id="example"></table>');
$('#example').dataTable({
"data": dataSet,
"columns": [
{ "title": "Center" },
{ "title": "Call Executive" },
{ "title": "Name" },
{ "title": "Mobile" },
{ "title": "Phone" },
{ "title": "Status" },
{ "title": "Appt Date" },
{ "title": "Joined Date" },
{ "title": "Remark" },
{ "title": "Source" },
{ "title": "Publisher" },
{ "title": "css" }, …Run Code Online (Sandbox Code Playgroud)