Advertisement
Guest User

date

a guest
Aug 19th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $(document).ready(function(){
  2.    
  3.  
  4.    var table = $("#example").DataTable({
  5.     responsive: true,
  6.     columnDefs: [
  7.             {
  8.  
  9.                 render: function ( data, type, row ) {
  10.                
  11.                 return '<input type="checkbox" class="data-check" value="'+row.id+'" onclick="showBottomDelete()" />';
  12.                 },
  13.                 targets: [0],
  14.                 orderable: false,
  15.                 searchable: false,
  16.                 className: 'noVis',
  17.             },
  18.             {
  19.                 targets: [1],
  20.                 never: false,
  21.                 orderable: false,
  22.                 searchable: false,
  23.                 className: 'noVis',
  24.             },
  25.             {
  26.                 render: function ( data, type, row ) {
  27.                 var d = moment(row.tanggal).format("dd-mmm-yyyy");
  28.                
  29.                 return d;
  30.                 },
  31.                 targets: [5],
  32.             },
  33.             {
  34.                 render: function edit_record( data, type, row ) {
  35.                
  36.                 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>';
  37.                 },
  38.                 targets: [8],
  39.                 orderable: false,
  40.                 searchable: false,
  41.             },
  42.     ],
  43.     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>>",
  44.     buttons: [
  45.         {
  46.             extend: 'copy',
  47.             text: '<span class="fa fa-copy"></span>',
  48.             className: 'btn btn-info',
  49.         },
  50.         {
  51.             extend: 'excel',
  52.             text: '<span class="fa fa-file-excel-o"></span>',
  53.             className: 'btn btn-info',
  54.         },
  55.         {
  56.             extend: 'pdf',
  57.             text: '<span class="fa fa-file-pdf-o"></span>',
  58.             className: 'btn btn-info',
  59.         },
  60.         {
  61.             extend: 'print',
  62.             text: '<span class="fa fa-print"></span>',
  63.             className: 'btn btn-info',
  64.         },
  65.         {
  66.                 extend: 'colvis',
  67.                 text: 'column Visibility',
  68.                 columns: ':not(.noVis)',
  69.                 collectionLayout: 'fixed two-column'
  70.         },
  71.     ],
  72.     paging: true,
  73.     pagingType: "simple_numbers",
  74.     lengthMenu: [[10,25,50,-1],[10,25,50,"All"]],
  75.     iDisplayLength: 10,
  76.     lengthChange: true,
  77.     searching: true,
  78.     ordering: true,
  79.     order: [1,"desc"],
  80.     info: true,
  81.     autoWidth: false,
  82.     scrollX: false,
  83.     oLanguage: {
  84.       sProcessing: "loading...",
  85.     },
  86.     processing: true,
  87.     serverSide: true,
  88.     ajax: {"url": "<?php echo site_url().'materi/qrmn/qrmn_datatable'?>", "type": "POST"},
  89.     columns:
  90.       [
  91.         {"data": null},
  92.         {"data": "id","class": "never"},
  93.         {"data": "surat"},  
  94.         {"data": "no_surat"},
  95.         {"data": "no_makna"},
  96.         {"data": "tanggal"},
  97.         {"data": "kelas"},
  98.         {"data": "pengajar"},
  99.         {"data": null},
  100.       ],
  101.    });
  102.  
  103. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement