Multiple Ajax Objects in One Cell
Multiple Ajax Objects in One Cell
Hello,
I am using ajax to populate my datatable. Our rest server has 2 objects for Name, one for first name, and one for last name. In my datatable, I want to combine those into one cell instead of needing to split it into two. Here is my current code:
$('#summary-contacts-table').dataTable({
ajax: {
url: restURL,
dataSrc: ""
},
dom: "Tfrtip",
bInfo: false,
searching: false,
paging: false,
columns: [
{ "data": "name_first" },
{ "data": "role" },
]
});
For the "data": "name_first"
, I want it to be something like "data": "name_last" + ", " + "name_first"
but the few ways I have tried to do this have resulted in datatables errors. Has anyone done something like this before? Is there a way to squish that data into one cell?
Thanks,
David Balderston
This question has an accepted answers - jump to answer
Answers
Amazing! Thank you very much ignignokt!