Init datatables even after ajax requests.

This commit is contained in:
Jan Böhmer 2019-03-26 15:49:50 +01:00
parent 6c96d8efad
commit c0f44b76f3
5 changed files with 53 additions and 42 deletions

View file

@ -6,7 +6,7 @@
<div class="card-header bg-primary text-white">
<h6>Bauteile</h6>
</div>
<div id="part_list" class="table-responsive">
<div id="part_list" class="table-responsive" data-datatable data-settings='{{ datatable_settings(datatable) }}'>
<div class="card-body">
<h4>{% trans %}part_list.loading.caption{% endtrans %}</h4>
<h6>{% trans %}part_list.loading.message{% endtrans %}</h6>
@ -15,15 +15,3 @@
</div>
{% endblock %}
{% block scripts %}
<script>
$( function() {
$('#part_list').initDataTables({{ datatable_settings(datatable) }},
{
"fixedHeader": { header: $(window).width() >= 768, //Only enable fixedHeaders on devices with big screen. Fixes scrolling issues on smartphones.
headerOffset: $("#navbar").height()}
});
});
</script>
{% endblock %}