gridjs icon indicating copy to clipboard operation
gridjs copied to clipboard

HTML Support in language

Open bastiedotorg opened this issue 4 years ago • 4 comments

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 avatar Oct 01 '20 07:10 bastiedotorg

@bastiedotorg can you share your code please? Have you tried using the formatter instead?

afshinm avatar Oct 03 '20 08:10 afshinm

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.

stale[bot] avatar Nov 02 '20 09:11 stale[bot]

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.

bastiedotorg avatar Nov 02 '20 17:11 bastiedotorg

I see. Yeah I can look in to that. I'm not entirely sure if the pagination buttons can accept HTML for their label.

afshinm avatar Dec 02 '20 21:12 afshinm