Advertisement
Guest User

Datatable

a guest
Aug 13th, 2019
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.34 KB | None | 0 0
  1. @{
  2. ViewBag.Title = "Ritasi";
  3. }
  4.  
  5. <div class="row">
  6. <div class="col-xs-12">
  7. <div id="" style="overflow:scroll; height:630px;">
  8. <table id="tableRitasiMain" class="table table-striped table-bordered table-hover">
  9. <thead>
  10. <tr class="center">
  11. <th>IDS</th>
  12. <th>No</th>
  13. <th>FROM</th>
  14. <th>TO</th>
  15. <th>TRUCK</th>
  16. <th>OPR. TRUCK</th>
  17. <th>TF. TRUCK</th>
  18. <th>EXCAVATOR</th>
  19. <th>OPR. EXCA</th>
  20. <th>TF. EXCA</th>
  21. <th>Material</th>
  22. <th>Block ID</th>
  23. <th>Polygon ID</th>
  24. <th>Time Start</th>
  25. <th>Time Load Start</th>
  26. <th>Time Load End</th>
  27. <th>Time Dump Start</th>
  28. <th>Time Dump End</th>
  29. <th>Time Empty</th>
  30. <th>Log Date</th>
  31. <th>Log By</th>
  32. </tr>
  33. </thead>
  34. <tbody>
  35. </tbody>
  36. </table>
  37. </div>
  38. <div class="space-6"></div>
  39. </div>
  40. </div>
  41.  
  42. <script type="text/javascript">
  43. var dataTablesList = null;
  44. $(document).ready(function () {
  45. $('.statusNav').removeClass('active'); $('#navRitasi').closest('li').addClass('active');
  46. dataTablesList = $('#tableRitasiMain').css('width', '').DataTable({
  47. "processing": true, // for show progress bar
  48. "serverSide": true, // for process server side
  49. "filter": false, // this is for disable filter (search box)
  50. "orderMulti": false, // for disable multiple column at once
  51. "pageLength": 10,
  52. "pagingType": "full_numbers",
  53. "colReorder": true,
  54. "drawCallback": function (settings) {
  55. $('#tableRitasiMain_paginate').addClass('text-right')
  56. $('#tableRitasiMain_paginate').removeClass('dataTables_paginate');
  57. var widthTable = $('#tableRitasiMain').css('width');
  58. $('#tableRitasiMain_wrapper').css('width', widthTable);
  59. },
  60. "ajax": {
  61. "url": '@Url.Action("getListRitasiRecord", "Ritasi")',
  62. "type": "POST",
  63. "contentType": "application/json",
  64. 'data': function (d) {
  65. // var equ_accpac = $('#src_equipment').val();
  66. // var operator = $('#src_employee').val();
  67. // var shift = $('#src_shift').val();
  68. // var start_date = $('#src_start_date').val();
  69. // var end_date = $('#src_end_date').val();
  70. var sortby = d.columns[d.order[0].column].data;
  71. var data = {
  72. start: d.start,
  73. length: d.length,
  74. sortby: sortby,
  75. sortdir: d.order[0].dir
  76. // equ_accpac: equ_accpac,
  77. // operators: operator,
  78. // shift: shift,
  79. // start_date: start_date,
  80. // end_date: end_date
  81. }
  82. return JSON.stringify(data);
  83. }
  84. },
  85. "columnDefs":
  86. [{
  87. "targets": [0],
  88. "visible": false,
  89. "searchable": false,
  90. "orderable": false
  91. },
  92. {
  93. "targets": [1],
  94. "visible": true,
  95. "searchable": false,
  96. "orderable": false,
  97. "className": "center",
  98. "modifier" : true
  99. },
  100. {
  101. "targets": [2],
  102. "visible": true,
  103. "searchable": false,
  104. "orderable": false,
  105. "className": "inputEdit",
  106. render: function (data, type, row) {
  107. return '<input type="text" id="Editbox1" class="myedit" " name="number" value="-1" spellcheck="false">'
  108. }
  109. },
  110. {
  111. "targets": [3],
  112. "visible": true,
  113. "searchable": false,
  114. "orderable": false,
  115. "className": "center"
  116. },
  117. {
  118. "targets": [4],
  119. "visible": true,
  120. "searchable": false,
  121. "orderable": false,
  122. "className": "center"
  123. },
  124. {
  125. "targets": [5],
  126. "visible": true,
  127. "searchable": false,
  128. "orderable": false,
  129. "className": "center"
  130. },
  131. {
  132. "targets": [6],
  133. "visible": true,
  134. "searchable": false,
  135. "orderable": false,
  136. "className": "center"
  137. },
  138. {
  139. "targets": [7],
  140. "visible": true,
  141. "searchable": false,
  142. "orderable": false,
  143. "className": "center"
  144. },
  145. {
  146. "targets": [8],
  147. "visible": true,
  148. "searchable": false,
  149. "orderable": false,
  150. "className": "center"
  151. },
  152. {
  153. "targets": [9],
  154. "visible": true,
  155. "searchable": false,
  156. "orderable": false,
  157. "className": "center"
  158. },
  159. {
  160. "targets": [10],
  161. "visible": true,
  162. "searchable": false,
  163. "orderable": false,
  164. "className": "center"
  165. },
  166. {
  167. "targets": [11],
  168. "visible": true,
  169. "searchable": false,
  170. "orderable": false,
  171. "className": "center"
  172. },
  173. {
  174. "targets": [12],
  175. "visible": true,
  176. "searchable": false,
  177. "orderable": false,
  178. "className": "center"
  179. },
  180. {
  181. "targets": [13],
  182. "visible": true,
  183. "searchable": false,
  184. "orderable": false,
  185. "className": "center"
  186. },
  187. {
  188. "targets": [14],
  189. "visible": true,
  190. "searchable": false,
  191. "orderable": false,
  192. "className": "center"
  193. },
  194. {
  195. "targets": [15],
  196. "visible": true,
  197. "searchable": false,
  198. "orderable": false,
  199. "className": "center"
  200. },
  201. {
  202. "targets": [16],
  203. "visible": true,
  204. "searchable": false,
  205. "orderable": false,
  206. "className": "center"
  207. },
  208. {
  209. "targets": [17],
  210. "visible": true,
  211. "searchable": false,
  212. "orderable": false,
  213. "className": "center"
  214. },
  215. {
  216. "targets": [18],
  217. "visible": true,
  218. "searchable": false,
  219. "orderable": false,
  220. "className": "center"
  221. },
  222. {
  223. "targets": [19],
  224. "visible": true,
  225. "searchable": false,
  226. "orderable": true,
  227. "className": "center"
  228. },
  229. {
  230. "targets": [20],
  231. "visible": true,
  232. "searchable": false,
  233. "orderable": false,
  234. "className": "center"
  235. }],
  236. "columns": [
  237. { "data": "IDS", "name": "IDS", "autoWidth": true },
  238. { "data": "rownum", "name": "rownum", "title": "No", "autoWidth": true },
  239. { "data": "loc_name_from", "title": "FROM", "name": "loc_name_from", "search": "", "value": "test", "autoWidth": false },
  240. { "data": "loc_name_to", "title": "TO", "name": "loc_name_to", "autoWidth": true },
  241. { "data": "truck_id", "title": "TRUCK", "name": "truck_id", "autoWidth": true },
  242. { "data": "operator_name", "title": "OPR TRUCK", "name": "operator_name", "autoWidth": true },
  243. { "data": "tf_truck", "title": "TF TRUCK", "name": "tf_truck", "autoWidth": true },
  244. { "data": "escavator_id", "title": "EXCAVATOR", "name": "escavator_id", "autoWidth": true },
  245. { "data": "operator_escavator_name", "title": "OPR EXCA", "name": "operator_escavator_name", "autoWidth": true },
  246. { "data": "tf_exca", "title": "TF EXCA", "name": "tf_exca", "autoWidth": true },
  247. { "data": "material_typ_name", "title": "Material", "name": "material_typ_name", "autoWidth": true },
  248. { "data": "block_id", "title": "Block ID", "name": "block_id", "autoWidth": true },
  249. { "data": "polygon_id", "title": "Polygon ID", "name": "polygon_id", "autoWidth": true },
  250. { "data": "time_start", "title": "Time Start", "name": "time_start", "autoWidth": true },
  251. { "data": "time_load_start", "title": "Time Load Start", "name": "time_load_start", "autoWidth": true },
  252. { "data": "time_load_end", "title": "Time Load End", "name": "time_load_end", "autoWidth": true },
  253. { "data": "time_dump_start", "title": "Time Dump Start", "name": "time_dump_start", "autoWidth": true },
  254. { "data": "time_dump_end", "title": "Time Dump End", "name": "time_dump_end", "autoWidth": true },
  255. { "data": "time_empty", "title": "Time Empty", "name": "time_empty", "autoWidth": true },
  256. { "data": "log_dt_show", "title": "Log Date", "name": "log_dt_show", "autoWidth": true },
  257. { "data": "log_by_name", "title": "Log By", "name": "log_by_name", "autoWidth": true }
  258. ]
  259. });
  260. })
  261.  
  262. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement