Translation of popoverTitle for colvis?
Translation of popoverTitle for colvis?
![thosefacts](https://secure.gravatar.com/avatar/6f3a10b7aa16da1b25964e3f9b82a345/?default=https%3A%2F%2Fvanillicon.com%2F6f3a10b7aa16da1b25964e3f9b82a345_200.png&rating=g&size=120)
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: