在我的ajax数据表中,我初始化了这个:
"ajax": {
"url": "{{ route('cust_continfo_data_table') }}",
"dataType": "json",
"type": "POST",
"data": {
_token: "{{ csrf_token() }}",
cust_id_copy: $("#cust_id_copy").val()
}
},
"columnDefs": [{
'targets': 4,
'createdCell': function (td, cellData, rowData, row, col) {
$(td).attr('title', 'columns');
}
}
],
"columns": [{
"data": "id"
}, {
"data": "receipt_date"
}, {
"data": "info_division_name"
}, {
"data": "contact_status"
}, {
"data": "note"
}, {
"data": "created_at"
}, {
"data": "updated_at"
}
],
如您所见,我只分配了静态值colum
n in:
$(td).attr('title', 'columns');
如何从"data":"note"
添加动态值?
答案 0 :(得分:1)
rowData
对象应具有属性note
'createdCell': function (td, cellData, rowData, row, col) {
$(td).attr('title', rowData.note);
}