Skip to content

Instantly share code, notes, and snippets.

@isu3ru
Created February 3, 2022 08:08
Show Gist options
  • Save isu3ru/243b7391dc980c470190ee743b8a4950 to your computer and use it in GitHub Desktop.
Save isu3ru/243b7391dc980c470190ee743b8a4950 to your computer and use it in GitHub Desktop.
var initGrnDetailsViewDataTable = function() {
$('#grn_list_table').DataTable({
ajax: {
url: base_url + 'grn/ajax_getGrnListDatatableData',
dataSrc: 'data'
},
columns: [
{ data: 'index' },
{ data: 'id' },
{ data:'date' },
{ data:'store_name' },
{ data:'type' },
{ data:'remarks' },
{ data: 'actions', render: function (id) { return '<a href="' + base_url + 'edit-grn/' + id + '" class="btn btn-primary btn-xs"><span class="fa fa-edit"></span> Edit</a>' } },
],
columnDefs: [
{ className: 'text-left', targets: [1, 2, 3, 4, 5] },
{ className: 'text-right', targets: [0, 6] },
]
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment