DatatablesBundle
DatatablesBundle copied to clipboard
Override specific language text
I would like to be able to load french translations and set a different custom text on each of my datatable (for example to set a different text for the language.emptyTable text).
This looks to not be possible at the moment.
Yo can add a callback
'init_complete' => array( 'template' => '_datatable_empty.js.twig', 'vars' => [ 'mess' => $this->translator->trans('datatable.empty') ], ) // or without translator just 'my text'
and in _datatable_empty.js.twig:
function init(settings, json) { $('.dataTables_empty').html("{{ mess }}"); }