Category: datatable

How can I get my datatable via ajax request?

I try to load my datatable via Ajax: base.html.twig: <button class=”button”>load table</button> <div class=”result”></div> $(‘.button’).on( ‘click’, function () { $.ajax({ method:’POST’, data: { “id”: id, }, url:'{{ path(‘table’) }}’, success : function (data) { $(“.result”).html(data.output); } }); }); Controller: /**…