I have a datatable that I want to show the information from my SharePoint List. The table has three headers: Name, Department and Address. The Address column should combine two SharePoint columns(Address Line 1 and Address Line 2) from the same list and display in that column.
How do I combine the two columns into one datatable column? The Address Line 2 should also start on the next line after Address Line 1.
This is my current code for the datatable.
function mySuccHandler(data) {
console.log(data);
$('#registration_table').DataTable({
"pageLength": 20,
"aaSorting": [],
"aLengthMenu": [[20, 50, 75, -1], [20, 50, 75, "All"]],
"iDisplayLength": 20,
"pagingType": "full_numbers",
"aaData": data.d.results,
"columnDefs": [
{
"targets": '_all',
"className": 'dt-left'
}
],
"order": [[4,"asc"]],
"aoColumns": [
{
"mData": "FullName"
},
{
"mData": "Dept"
},
{
"mData": "AddressLine1"
},
{
"mData": "AddressLine2"
}
]
});
}