mirror of
https://github.com/FAUSheppy/tmnf-replay-server.git
synced 2025-12-09 08:28:34 +01:00
wip: map info datatables
This commit is contained in:
34
templates/datatable.html
Normal file
34
templates/datatable.html
Normal file
@@ -0,0 +1,34 @@
|
||||
<div style="font-size: 16px; font-weight: 300;" class="mt-5 mb-3 ml-2 mr-2" role="main">
|
||||
<table id="tableMain" class="table table-striped table-bordered table-sm"
|
||||
cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
{% for item in header_col %}
|
||||
<th class="th-sm font-weighIt-bold">{{ item }}</th>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
</thead>
|
||||
<!-- tbody serverside processing -->
|
||||
</table>
|
||||
<script defer>
|
||||
var dt = null
|
||||
$(document).ready(function () {
|
||||
dt = $('#tableMain').DataTable({
|
||||
serverSide: true,
|
||||
ajax: {
|
||||
url: '/data-source',
|
||||
type: 'POST'
|
||||
},
|
||||
"columnDefs": [
|
||||
{
|
||||
"targets": 3,
|
||||
"render": function ( data, type, full, meta ) {
|
||||
return '<a href=\"/static/'+data+'\" download>Download</a>';
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
$('.dataTables_length').addClass('bs-select');
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
Reference in New Issue
Block a user