Advertisement
MagzyieBogues

Untitled

Jun 13th, 2024
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.97 KB | None | 0 0
  1. ASP CLASSIC TABLE CREATION:
  2. table = "<table id='myTable' class='cell-border compact stripe'><thead><tr>" & _
  3. "<th">ID</th>" & _
  4. "<th>Local</th>" & _
  5. "<th>Nome</th>" & _
  6. "<th>&nbsp;Email&nbsp;</th>" & _
  7. "<th>&nbsp;Telefone&nbsp;</th>" & _
  8. "<th>&nbsp;Dt Status&nbsp;</th>" & _
  9. "<th>&nbsp;Status&nbsp;</th>" & _
  10. "<th>&nbsp;Instalacao&nbsp;</th>" & _
  11. "<th>&nbsp;Contrato&nbsp;</th>" & _
  12. "</tr></thead><tbody>"
  13.  
  14. LOOP
  15. table = table & "<tr>" & _
  16. "<td>" & objrs("id") & "</td>" & _
  17. "<td>" & objrs("lugar") & "</td>" & _
  18. "<td>" & objrs("nome") & "</td>" & _
  19. "<td>" & objrs("email") & "</td>" & _
  20. "<td>" & objrs("telefone") & "</td>" & _
  21. "<td>" & formatedDateUltimaAcao & "</td>" & _
  22. "<td>" & objrs("descricaoUltimaAcao") & "</td>" & _
  23. "<td>" & formatedDateInstalacao & "</td>" & _
  24. "<td>" & boolToStringContrato & "</td>" & _
  25. "</tr>"
  26. END LOOP
  27.  
  28. table = table & "</tbody></table>"
  29.  
  30. DATATABLES CONFIGURATION:
  31. <!DOCTYPE html>
  32. <html lang="en">
  33. <head>
  34. <meta charset="UTF-8">
  35. <title>DataTables Integration</title>
  36.  
  37. <!--
  38. <link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/5.3.0/css/bootstrap.min.css" rel="stylesheet">
  39. -->
  40.  
  41. <link href="https://cdn.datatables.net/v/dt/dt-2.0.8/datatables.min.css" rel="stylesheet">
  42.  
  43. <!-- jQuery -->
  44. <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
  45. <!-- DataTables JS -->
  46. <script src="https://cdn.datatables.net/v/dt/dt-2.0.8/datatables.min.js"></script>
  47. <!-- Bootstrap
  48. <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/5.3.0/js/bootstrap.bundle.min.js"></script>
  49. -->
  50.  
  51. <!-- Extensions -->
  52. <link href="https://cdn.datatables.net/v/dt/jszip-3.10.1/dt-2.0.8/b-3.0.2/b-colvis-3.0.2/b-html5-3.0.2/b-print-3.0.2/cr-2.0.3/fh-4.0.1/kt-2.12.1/sp-2.3.1/sr-1.4.1/datatables.min.css" rel="stylesheet">
  53. <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
  54. <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
  55. <script src="https://cdn.datatables.net/v/dt/jszip-3.10.1/dt-2.0.8/b-3.0.2/b-colvis-3.0.2/b-html5-3.0.2/b-print-3.0.2/cr-2.0.3/fh-4.0.1/kt-2.12.1/sp-2.3.1/sr-1.4.1/datatables.min.js"></script>
  56. <style>
  57. .dt-length {
  58. margin-block:10px;
  59. }
  60.  
  61. .dt-search {
  62. padding-top:55px;
  63. }
  64. </style>
  65. </head>
  66. <body>
  67.  
  68. <!-- DataTables Initialization -->
  69. <script type="text/javascript">
  70. $(document).ready(function() {
  71. var table = $('#myTable').DataTable({
  72. stateSave: true,
  73. keys: true,
  74. colReorder: true,
  75. columnDefs: [{ width: 20, targets: 0 },{ width: 200, targets: 1 }],
  76. scrollCollapse: true,
  77. scrollY: '300px',
  78. language: {
  79. paginate: {
  80.  
  81. },
  82. aria: {
  83. paginate: {
  84.  
  85. }
  86. },
  87. },
  88. pagingType: 'full_numbers',
  89. pageLength: 100,
  90. layout: {
  91. topEnd: {
  92. search: {
  93. placeholder: 'Search here...',
  94. }
  95. },
  96. topStart: {
  97. pageLength: {
  98. menu: [ 10, 25, 50, 100, { label: 'All', value: -1 }]
  99. },
  100. buttons: [
  101. 'copy', 'print',
  102. {
  103. extend: 'createState',
  104. config: {
  105. creationModal: true,
  106. toggle: {
  107. columns: {
  108. search: true,
  109. visible: true
  110. }
  111. }
  112. }
  113. },
  114. {
  115. extend: 'savedStates',
  116. config: {
  117. columns: {
  118. search: false
  119. }
  120. }
  121. }, 'removeAllStates',
  122. {
  123. extend: 'colvis',
  124. postfixButtons: ['colvisRestore']
  125. },
  126. {
  127. extend: 'spacer',
  128. style: 'bar',
  129. text: 'Export files:'
  130. },
  131. 'excel', 'pdf',
  132. ]
  133. },
  134. bottomEnd: {
  135. paging: {
  136.  
  137. }
  138. }
  139. }
  140. });
  141. });
  142.  
  143. </script>
  144. </body>
  145. </html>
  146.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement