I have an old django app that I am moving into a docker container. It uses:
Django==1.8.6
django-datatable-view==0.8.2
django-extensions==1.5.9
django-formtools==1.0
This is my template:
{% load static %}
{% autoescape off %}
<script src="{% static 'js/datatableview.js' %}"></script>
<script>
datatableview.auto_initialize = false;
$(function(){
var table = datatableview.initialize($('.datatable'), {
lengthMenu: [ [ 10, 25, 50, 100, -1], [10, 25, 50, 100, "All"] ],
{% if editable %}
fnRowCallback: datatableview.make_xeditable({}),
{% endif %}
{% if page_length %}
bPaginate: true,
iDisplayLength: {{ page_length }},
{% else %}
bPaginate: false,
{% endif %}
{% if filter %}
bFilter: true,
{% else %}
bFilter: false,
{% endif %}
{% if dom %}
sDom: '{% if export %}B{% endif %}{{ dom }}',
{% else %}
sDom: 'lrftip',
{% endif %}
{% if export %}
buttons: [
"copy",
"print",
"csvHtml5",
"excelHtml5",
"pdfHtml5"
],
{% endif %}
});
});
</script>
{% endautoescape %}
and this is the result:
the working version (in another server and not running in a docker component) give this result:
as you can see I am missing the export buttons: Copy, Print, CSV, etc
Even if I remove the if statement around the buttons' code, the buttons are not showing:
{% endif %}
{% if dom %}
sDom: '{% if export %}B{% endif %}{{ dom }}',
{% else %}
sDom: 'lrftip',
{% endif %}
buttons: [
"copy",
"print",
"csvHtml5",
"excelHtml5",
"pdfHtml5"
],
});
So I guess I am missing some css or js file but I cannot find any documentation specific to the version of the table I am using. Can anyone help?
question from:
https://stackoverflow.com/questions/65848797/django-1-8-6-django-datatable-view-0-8-2-export-buttons-not-showing