Reputation: 94
database table fields : id,first_name,last_name,email
datatable : full_name,email (without id) ?
<script type="text/javascript">
$(document).ready(function () {
var table = $('#havuz_table').DataTable({
"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],
"ajax": "{{URL::to('ajaxUzmanListesi/')}}",
"language": {
"url": '/lib/datatables/language/Turkish.json'
},
"columns": [
{
"mData": null ,
"mRender" : function ( data, type, full ) {
return full['first_name']+''+full['last_name'];}
}
]
});
});
Upvotes: 2
Views: 1210
Reputation: 5699
Try this:
"columns": [{
"data": null,
"title": "Name",
"render": function(data, type, full) {
return full['first_name'] + ' ' + full['last_name'];
}
},
{
"data": "email",
"title": "Email"
}
]
Working JSFiddle here. Hope that helps.
Upvotes: 4