Skip to content

Commit 6622b4b

Browse files
davorgbook
authored andcommitted
Add basic datatable support
1 parent ee1e342 commit 6622b4b

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

in/index.tt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<p>Welcome to the Proposed Perl Changes web site.</p>
44

55
<p>Download this data as <a href="./ppcs.json">JSON</a></p>
6-
<table class="table">
6+
<table class="table" id="datatable">
77
<thead>
88
<tr>
99
<th>ID</th>
@@ -25,3 +25,13 @@
2525
[% END -%]
2626
</tbody>
2727
</table>
28+
29+
<script>
30+
window.dt = new window.simpleDatatables.DataTable("#datatable", {
31+
perPageSelect: [5, 10, 15, ["All", -1]],
32+
columns: [{
33+
select: 0,
34+
type: "numeric"
35+
}]
36+
});
37+
</script>

ttlib/page.tt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@
3636
}
3737
}
3838
</style>
39+
40+
<!-- Data table created using https://github.com/fiduswriter/Simple-DataTables -->
41+
<link href="https://cdn.jsdelivr.net/npm/simple-datatables@latest/dist/style.css"
42+
rel="stylesheet" type="text/css">
43+
<script src="https://cdn.jsdelivr.net/npm/simple-datatables@latest"
44+
type="text/javascript"></script>
3945

4046
<!-- Custom styles for this template -->
4147
<link href="./style.css" rel="stylesheet">

0 commit comments

Comments
 (0)