Skip to content

Commit

Permalink
DataTable dom
Browse files Browse the repository at this point in the history
  • Loading branch information
73616e646572 committed Nov 5, 2024
1 parent 9dcff01 commit 5de9895
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion web/macros.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<th colspan="8">
<div id="main-footer">
<p>Made with ♡ by Utrecht University's <a href="https://cdh.uu.nl/" target="_blank">Centre for Digital Humanities</a></p>
<div id="table-info">Table info</div>
<div id="table-info"></div>
<div id="table-pagination"></div>
</div>
</th>
Expand Down
14 changes: 11 additions & 3 deletions web/page.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,15 @@
</html>

<script>
new DataTable('#fair-table', {
pageLength: 50
$(document).ready(function() {
$('#fair-table').DataTable({
pageLength: 50,
dom: '<"top"lf>rt<"bottom"ip><"clear">',
drawCallback: function(settings) {
var api = this.api();
$('#table-info').html(api.page.info().recordsDisplay + ' entries');
$('#table-pagination').html($(api.table().container()).find('.dataTables_paginate'));
}
});
});
</script>
</script>

0 comments on commit 5de9895

Please sign in to comment.