From 7a930ee281f61b575e7442d28e13f8c650dbc1c1 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 1 Aug 2017 11:33:12 +0200 Subject: [PATCH] register events before datatable get initialized --- Resources/views/datatable/datatable_js.html.twig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Resources/views/datatable/datatable_js.html.twig b/Resources/views/datatable/datatable_js.html.twig index b319989c..61de6dcc 100644 --- a/Resources/views/datatable/datatable_js.html.twig +++ b/Resources/views/datatable/datatable_js.html.twig @@ -67,10 +67,13 @@ $.extend(defaults, initialSearch); if (!$.fn.dataTable.isDataTable(selector)) { + $(selector) + {% include 'SgDatatablesBundle:datatable:events.html.twig' %} + ; + oTable = $(selector) .DataTable(defaults) .on('draw.dt', function() { postCreateDatatable({{ sg_datatables_view.ajax.pipeline}}) }) - {% include 'SgDatatablesBundle:datatable:events.html.twig' %} ; {% if true == sg_datatables_view.options.individualFiltering %}