Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ASP CLASSIC TABLE CREATION:
- table = "<table id='myTable' class='cell-border compact stripe'><thead><tr>" & _
- "<th">ID</th>" & _
- "<th>Local</th>" & _
- "<th>Nome</th>" & _
- "<th> Email </th>" & _
- "<th> Telefone </th>" & _
- "<th> Dt Status </th>" & _
- "<th> Status </th>" & _
- "<th> Instalacao </th>" & _
- "<th> Contrato </th>" & _
- "</tr></thead><tbody>"
- LOOP
- table = table & "<tr>" & _
- "<td>" & objrs("id") & "</td>" & _
- "<td>" & objrs("lugar") & "</td>" & _
- "<td>" & objrs("nome") & "</td>" & _
- "<td>" & objrs("email") & "</td>" & _
- "<td>" & objrs("telefone") & "</td>" & _
- "<td>" & formatedDateUltimaAcao & "</td>" & _
- "<td>" & objrs("descricaoUltimaAcao") & "</td>" & _
- "<td>" & formatedDateInstalacao & "</td>" & _
- "<td>" & boolToStringContrato & "</td>" & _
- "</tr>"
- END LOOP
- table = table & "</tbody></table>"
- DATATABLES CONFIGURATION:
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>DataTables Integration</title>
- <!--
- <link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/5.3.0/css/bootstrap.min.css" rel="stylesheet">
- -->
- <link href="https://cdn.datatables.net/v/dt/dt-2.0.8/datatables.min.css" rel="stylesheet">
- <!-- jQuery -->
- <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
- <!-- DataTables JS -->
- <script src="https://cdn.datatables.net/v/dt/dt-2.0.8/datatables.min.js"></script>
- <!-- Bootstrap
- <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/5.3.0/js/bootstrap.bundle.min.js"></script>
- -->
- <!-- Extensions -->
- <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">
- <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
- <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>
- <style>
- .dt-length {
- margin-block:10px;
- }
- .dt-search {
- padding-top:55px;
- }
- </style>
- </head>
- <body>
- <!-- DataTables Initialization -->
- <script type="text/javascript">
- $(document).ready(function() {
- var table = $('#myTable').DataTable({
- stateSave: true,
- keys: true,
- colReorder: true,
- columnDefs: [{ width: 20, targets: 0 },{ width: 200, targets: 1 }],
- scrollCollapse: true,
- scrollY: '300px',
- language: {
- paginate: {
- },
- aria: {
- paginate: {
- }
- },
- },
- pagingType: 'full_numbers',
- pageLength: 100,
- layout: {
- topEnd: {
- search: {
- placeholder: 'Search here...',
- }
- },
- topStart: {
- pageLength: {
- menu: [ 10, 25, 50, 100, { label: 'All', value: -1 }]
- },
- buttons: [
- 'copy', 'print',
- {
- extend: 'createState',
- config: {
- creationModal: true,
- toggle: {
- columns: {
- search: true,
- visible: true
- }
- }
- }
- },
- {
- extend: 'savedStates',
- config: {
- columns: {
- search: false
- }
- }
- }, 'removeAllStates',
- {
- extend: 'colvis',
- postfixButtons: ['colvisRestore']
- },
- {
- extend: 'spacer',
- style: 'bar',
- text: 'Export files:'
- },
- 'excel', 'pdf',
- ]
- },
- bottomEnd: {
- paging: {
- }
- }
- }
- });
- });
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement