I am trying to add button in the last column of the table. How can i do it?
I am trying to add button in the last column of the table. How can i do it?
var oTable = $('#table').DataTable({
"bProcessing": true,
"bServerSide": true,
"bSearchable": true,
"sAjaxSource": '<?php echo site_url('members/viewall'); ?>',
"sPaginationType": "full_numbers",
"fnServerData": function (sSource, aoData, fnCallback) {
$.ajax
({
'dataType': 'json',
'type': 'POST',
'url': sSource,
'data': aoData,
'success': fnCallback
});
},
"aoColumnDefs": [ {
"mRender": function(data){
var id = data[0];
var btnEdit = '<a id="memberId" class="btn btn-primary"href="' + '<?php echo site_url('members/editmember'); ?>' + '/' + id + '">' + '<i class="fa fa-edit"></i> Edit' + '</a>';
var btnDelete = '<a id="memberId" class="btn btn-danger"href="' + '<?php echo site_url('members/deletemember'); ?>' + '/' + id + '">' + '<i class="fa fa-delete"></i> Delete' + '</a>';
return btnEdit + ' ' + btnDelete;
},
"sWidth": '15%'
}]
});