我想从具有数据表的不同列访问属性。
例如:
columnDefs: [
{
"targets": 4,
"data": "default_price_with_discount",
"sClass": "text-center",
"render": function (data, type, full, meta) {
return '<strong>' + data + '</strong>';
}
},
{
"targets": 5,
"data": "default_bonus",
"sClass": "text-center",
"render": function (data, type, full, meta) {
// how can i acccess here column 4?
return '<strong>' + data + '</strong>';
}
},
有关如何从第5列访问第4列的任何想法吗?
答案 0 :(得分:1)
“full”将包含row的所有列值。例如
{
"targets": 5,
"data": "default_bonus",
"sClass": "text-center",
"render": function (data, type, full, meta) {
var column4Value = full.default_price_with_discount;
return '<strong>' + data + '</strong>';
}
},