Override CDN language output
Override CDN language output
Language is pull base on user preference, say you want German, DataTables will show you German Language, this is done dynamically, there one thing that I can't override, that the Pagination "Previous" and "Next", I'm using custom theme, pagination buttons are optimized for 3 digits max so fat it looks great but the word "Previous", "Next" and "Last", I want to use Favicons
"language": {
url: _languageUrl,
paginate: {
next: '<span><i class="fas fa-angle-right"></i></span>',
previous: '<span><i class="fas fa-angle-left"></i></span>'
}
}
But this is not working, it keep showing whatever the language file have...
Is there a way to override only that part?
I can forcefully do it using JavaScript, tempering with the final DOM but I think that is not the best way to do it nor do I want to do it...
Answers
Unfortunately, no - not yet. The next major version of DataTables will fix that, but at the moment, loading from a URL means that you can't change any of the other options locally. The only way to do that is to Ajax load the language JSON yourself, modify it as required and then pass the resulting object to
language
when you initialise the table.Allan
Hi, I solved it by omitting the url property