How can i add buttons to my datatables on each row? With my code, it looks like there is something i am not doing right.
How can i achieve this?
HTML
<table id="users-table" class="table table-hover table-condensed" style="width:100%">
<thead>
<tr>
<th>Name</th>
<th>Grade</th>
<th>Action</th>
</tr>
</thead>
</table>
JS
$(document).ready(function() {
oTable = $('#users-table').DataTable({
"processing": true,
"serverSide": true,
"ajax": "{{ route('datatable.getpost') }}",
"columns": [
{data: 'name', name: 'name'},
{data: 'description', name: 'description'},
{data: 'no_of_items', name: 'no_of_items'},
],
"aoColumns": [{
{
"mRender": function(data, type, full) {
return '<a class="btn btn-info btn-sm" href=#>' + 'Edit' + '</a>';
}
}
}]
});
});
