Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function(){
- var table = $("#example").DataTable({
- responsive: true,
- columnDefs: [
- {
- render: function ( data, type, row ) {
- return '<input type="checkbox" class="data-check" value="'+row.id+'" onclick="showBottomDelete()" />';
- },
- targets: [0],
- orderable: false,
- searchable: false,
- className: 'noVis',
- },
- {
- targets: [1],
- never: false,
- orderable: false,
- searchable: false,
- className: 'noVis',
- },
- {
- render: function ( data, type, row ) {
- var d = moment(row.tanggal).format("dd-mmm-yyyy");
- return d;
- },
- targets: [5],
- },
- {
- render: function edit_record( data, type, row ) {
- return '<a href="javascript:void(0);" class="btn btn-sm btn-primary" onclick="edit_user('+row.id+')"><i class="fa fa-pencil"></i> Edit</a>';
- },
- targets: [8],
- orderable: false,
- searchable: false,
- },
- ],
- dom: "<'row'<'col-sm-6 mb-3'B>>"+"<'row'<'col-sm-6'l><'col-sm-6'f>>" + "<'row'<'col-sm-12'tr>>" + "<'row'<'col-sm-5'i><'col-sm-7'p>>",
- buttons: [
- {
- extend: 'copy',
- text: '<span class="fa fa-copy"></span>',
- className: 'btn btn-info',
- },
- {
- extend: 'excel',
- text: '<span class="fa fa-file-excel-o"></span>',
- className: 'btn btn-info',
- },
- {
- extend: 'pdf',
- text: '<span class="fa fa-file-pdf-o"></span>',
- className: 'btn btn-info',
- },
- {
- extend: 'print',
- text: '<span class="fa fa-print"></span>',
- className: 'btn btn-info',
- },
- {
- extend: 'colvis',
- text: 'column Visibility',
- columns: ':not(.noVis)',
- collectionLayout: 'fixed two-column'
- },
- ],
- paging: true,
- pagingType: "simple_numbers",
- lengthMenu: [[10,25,50,-1],[10,25,50,"All"]],
- iDisplayLength: 10,
- lengthChange: true,
- searching: true,
- ordering: true,
- order: [1,"desc"],
- info: true,
- autoWidth: false,
- scrollX: false,
- oLanguage: {
- sProcessing: "loading...",
- },
- processing: true,
- serverSide: true,
- ajax: {"url": "<?php echo site_url().'materi/qrmn/qrmn_datatable'?>", "type": "POST"},
- columns:
- [
- {"data": null},
- {"data": "id","class": "never"},
- {"data": "surat"},
- {"data": "no_surat"},
- {"data": "no_makna"},
- {"data": "tanggal"},
- {"data": "kelas"},
- {"data": "pengajar"},
- {"data": null},
- ],
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement