$("[data-manifest-table]").DataTable({
"processing": true,
"serverSide": true,
ajax: {
url: "LoadManifestData",
type: "POST",
data: { FilterItem: new FilterItem($("[data-statuses]").val(), $("[data-products]").val(), $("[data-field-reps]").val(), $("[data-states]").val(), $("[data-clients]").val()), __RequestVerificationToken: ReturnAntiForgeryToken() },
error: function (jqXHR, textStatus, errorThrown) {
alert("woot");
}
},
"columns": [
{ "data": "ClientID" },
{ "data": "TransNo" },
{ "data": "Assigned" },
{ "data": "Due" },
{ "data": "DebtorBusiness" },
{ "data": "Address" },
{ "data": "Appt" },
{ "data": "FieldRep" },
],
"render": function (data, type, row) {
debugger
$("td:eq(6)", row).html("<p>hdfg</p>")
},
});
我有这个数据表初始化器,我试图点击渲染功能,因为我想修改数据。但是渲染功能不会受到影响。谁知道为什么?
答案 0 :(得分:1)
它应该是columns
选项的子属性。
"columns": [
{ "data": "ClientID" },
{ "data": "TransNo" },
{ "data": "Assigned" },
{ "data": "Due" },
{ "data": "DebtorBusiness" },
{ "data": "Address" },
{
"data": "Appt",
"render": function(data, type, full, meta){
if(type === 'display'){
data = "<p>hdfg</p>";
}
return data;
}
},
{ "data": "FieldRep" }
],
有关详细信息,请参阅columns.render
。