DatatablesBundle icon indicating copy to clipboard operation
DatatablesBundle copied to clipboard

Override specific language text

Open Seb33300 opened this issue 7 years ago • 1 comments

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.

Seb33300 avatar Oct 10 '18 12:10 Seb33300

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 }}"); }

golebiowska avatar Oct 10 '18 14:10 golebiowska