-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault.htm
89 lines (69 loc) · 3.36 KB
/
default.htm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>DataTables Example Classic ASP/VBScript</title>
<!-- jQuery -->
<script src="asplite/jquery.js"></script>
<!-- Bootstrap -->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
<!-- DataTables -->
<link href="https://cdn.datatables.net/v/bs5/jszip-3.10.1/dt-2.0.3/b-3.0.1/b-colvis-3.0.1/b-html5-3.0.1/b-print-3.0.1/r-3.0.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/bs5/jszip-3.10.1/dt-2.0.3/b-3.0.1/b-colvis-3.0.1/b-html5-3.0.1/b-print-3.0.1/r-3.0.1/datatables.min.js"></script>
<!-- REQUIRED AJAX functions for aspLite - jQuery REQUIRED! -->
<script>
var aspLiteAjaxHandler='default.asp'
</script>
<!-- aspLite -->
<script src="asplite/asplite.js"></script>
</head>
<body>
<main>
<div class="container">
<p></p>
<div class="alert alert-success">
<h3>How to use DataTables with classic ASP/VBScript?</h3>
<p><i>"DataTables is a plug-in for the jQuery Javascript library. It is a highly flexible tool, built upon the foundations of progressive enhancement, that adds all of these advanced features to any HTML table."</i> (source: <a target="_blank" href="https://datatables.net/">https://datatables.net/</a>)</p>
<p><strong>Default.htm</strong> holds an Ajax-driven DataTable. <strong><a href="recordset.asp">Recordset.asp</a></strong> flushes the JSON it takes to build the DataTable. <strong>Datatables.asp</strong> holds a class with reusable code. <a target="_blank" href="https://www.asplite.com">aspLite</a> is used for its JSON-features and some other general functions. Everything is wrapped in Bootstrap 5. Have fun!</p>
<p>The code for this sample can be <a target="_blank" href="https://github.com/aspLite/DataTables">downloaded here</a>.</p>
</div>
<table id="example" class="table table-striped" style="width:100%">
<thead>
<tr>
<th>col1</th>
<th>col2</th>
<th>col3</th>
<th>col4</th>
</tr>
</thead>
</table>
<script>
$(document).ready(function() {
$('#example').DataTable( {
"order": [[ 0, 'asc' ]],
"responsive": true,
"dom": 'Blfrtip',
"buttons": ['copy', 'excel', 'csv', 'pdf', 'print', 'colvis'],
"serverSide": true,
"ajax": 'recordset.asp',
"processing": true,
"columnDefs": [
{"targets": '_all',"render":$.fn.dataTable.render.text()}
],
"columns": [
{ "data": "col1"},
{ "data": "col2"},
{ "data": "col3"},
{ "data": "col4"}
]
} );
} );
</script>
</div>
</main>
</body>
</html>