Anda di halaman 1dari 2

function masalah() {

var KTDatatablesDataSourceAjaxServer = function() {


var initTable1 = function() {
var table = $('#kt_table_kategori');
// begin first table
table.DataTable({
responsive: true,
searchDelay: 500,
processing: true,
serverSide: true,
ajax: '{{url("/load-layanan-lab")}}',
columns: [
{data: 'id_ktgr_lab',
render: function (data, type, row, meta) {
return meta.row + meta.settings._iDisplayStart + 1;
}},
{data: 'nama_layanan'},
{data: 'items'},
{data: 'ket'},
{data: null, responsivePriority: -1},
],
columnDefs: [
{targets:[0],orderable:true, searchable: false,
className:"text-center"},
{targets:[2],className:"text-center"},
{
targets: -1,
data:'id_ktgr_lab',
title: 'Actions',
orderable: false,
searchable: false,
className:"text-center",
render: function(data, type, full, meta) {
return '<span class="dropdown"><a href="#"
class="btn btn-sm btn-clean btn-icon btn-icon-md" data-toggle="dropdown" aria-
expanded="true"><i class="la la-ellipsis-h"></i></a><div class="dropdown-menu
dropdown-menu-right"><a class="dropdown-item" href="javascript:void(0);"
onclick="Details('+data['id_ktgr_lab']+')"><i class="la la-list-ol"></i> Details
Items</a><a class="dropdown-item" href="javascript:void(0);"
onclick="DelData('+data['id_ktgr_lab']+')" titel="Delete Data"><i class="la la-
trash-o"></i> Hapus Kategori</a></div></span><a class="btn btn-sm btn-clean btn-
icon btn-icon-md" href="javascript:void(0);"
onclick="EditData('+data['id_ktgr_lab']+')" titel="Edit Data"><i class="la la-
edit"></i></a>';
},
},
],
retrieve: true,
paging: true,
});
};

return {

//main function to initiate the module


init: function() {
initTable1();
},
};

}();
KTDatatablesDataSourceAjaxServer.init();
}
/*jQuery(document).ready(function() {
KTDatatablesDataSourceAjaxServer.init();
});*/

Anda mungkin juga menyukai