Translation of popoverTitle for colvis?
Translation of popoverTitle for colvis?
thosefacts
Posts: 9Questions: 2Answers: 0
Hello. Is it possible to translate the popoverTitle for colvis? I have tried using
popoverTitle: function(dt) { dt.i18n('buttons.colvis.popoverTitle', '') };
instead of a string, but this just outputs the function declaration as a text.
layout: {
topStart: {
buttons: [
{
extend: 'colvis',
columns: ':not(:first-child)',
popoverTitle: 'Missing translation options?',
postfixButtons: ['colvisRestore']
},
]
},
This question has an accepted answers - jump to answer
Answers
The
popoverTitle
option ofcollection
only allows a string at the moment, so you'd need to to the translation up front. There isn't currently an option to have it has a function, but I think that is a good idea and I've logged that to make the change.Allan
Thank you for the answer, Allan. Yes it would be nice to have that as an option. I figured out that I can call the appropriate path for the translation. Short example on how it can be done:
JSON:
JS: