gridjs
gridjs copied to clipboard
HTML Support in language
Hi,
I tried to use font-awesome icons in the translated strings. Unfortunately, gridjs did not like that and reverted to the default string when I added gridjs.html around it. Without it, the source was displayed.
BR Bastian
@bastiedotorg can you share your code please? Have you tried using the formatter
instead?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hi, sorry for the delay. Minimum example:
new gridjs.Grid({
data: [
['Mike', 33, '[email protected]'],
['John', 82, '[email protected]'],
['Sara', 26, '[email protected]'],
['Mike', 33, '[email protected]'],
['John', 82, '[email protected]'],
['Sara', 26, '[email protected]'],
['Mike', 33, '[email protected]'],
],
pagination: {
limit: 3,
},
columns: ['Name', 'Age', 'Email'],
search: true,
language: {
pagination: {
previous: gridjs.html(`<i class="fas fa-rabbit"></i>`),
next: '>',
}
}
}).render(document.getElementById('wrapper'));
Expectation: Previous button has the font-awesome rabbit. Reality: Previous button has the default "previous" text.
If I leave gridjs.html out, the plain html is displayed.
I see. Yeah I can look in to that. I'm not entirely sure if the pagination buttons can accept HTML for their label.