@Baluga145, I'm not sure if communities are happy when the exact same question is asked within a few hours in two separate communities... Doesn't seem respectful to peoples time spent. Isn't it?
The forum of datatables.net seems to be the most appropriate place to ask something about... uhh.. datatables.
Sorry didn't think that disturbed anyone my idea was more that I'm not sure which community was the right. That the same question is answered twice was not my intention.
I hope it will help out other people, if I found a solution I will post it.
@Baluga145, I did some research on datatables.net and couldn't find anything resembling your code. Then I realised you are using the Grav plugin 'datatables' which adds a shortcode to add the jQuery plugin 'datatables' to a page...
The plugin is already a bit dated and I couldn't get it to work out of the box. I needed to alter a Twig template of the plugin.
The following steps will create you a working datatable populated with data from an Ajax request:
Create a fresh Grav installation
Add the plugins 'datatables' and 'shortcode-core' using:
If your website is not on the same domain as 'assets.bunzl.ch' you will probably run into 'cross-origin' errors preventing you from accessing the data.
As said, I couldn't get the plugin 'datatables' to work out of the box. I had to change its template 'datatables.html.twig'.
Before you can do this, you will have to create a child theme as described in the documentation on Theme Inheritance
In your new child theme (called 'mytheme' hereafter), copy file '/user/plugins/datatables/templates/partials/datatables.html.twig' into 'user/themes/mytheme/templates/partials/'. Replace the content with the following code: