django-ajax-datatable
django-ajax-datatable copied to clipboard
Loding language file from url discards column definition
Hello all, I would like to load a language file as json during initialization instead of entering all translations manually. For this I wrote the following code
<script type="text/javascript">
$(document).ready(function() {
AjaxDatatableViewUtils.initialize_table(
$('#datatable_{{ event.slug }}'),
"{% url 'issue_datatable' %}",
{
processing: false,
autoWidth: true,
full_row_select: false,
scrollX: false,
language: {
url: "{% static 'datatables/de-DE.json' %}"
},
}, {
slug: '{{ event.slug }}',
}
);
});
</script>
If I include the language package like this, all configurations I made in Python, e.g. autofilter or orderable settings are discarded. The table is rendered without autofilter and orderable. However, the language pack is loaded correctly.
If I enter the translations manually, as it says in the instructions, everything works fine.
I also tried putting the language + url inside AjaxDatatableViewUtils.init() but this didn't worked too.
Edit: this is the link to the language file: https://cdn.datatables.net/plug-ins/1.12.0/i18n/de-DE.json