List / library control: Change text in the footer and type of currency

I have the datatable produced by the list control in Sharepoint.
I have a footer with the sums.
I have tried to change the currency and a text in this way, but the result is erratic, and it continues to show the wrong currency most of the times.

I execute this in the load and in the ready of the datatable, but it does not work.

$('.' + datatable).find(".k-footer-template").html(function(index, oldHtml) {
return oldHtml.replace(/zł/g, "€");
});

It should work if you apply this directly in the console of the browser, but there is a moment where is overwritten like when you push the next button when paginating etc...

Any ideas.

Hello @Miguel,

Why do you need to programmatically change the currency symbol? The total row shows the currency of the column, which can be changed in the column settings:

To change the text, you can use the setInterval() method.

The column was defined with a currency, but we have several projects from different countries and currencies, so depending on a filter on the top, we have to make this dynamic.
Which would be the full code, please? Taking into account we are using the buttons of the paging, but we don't locate the event for this. For the moment we try to act in the ready event of the datatable without success.
We don't find no footer template which we could use either. We can use templates for rows as you know but not for footer.

thx!

@Miguel,

You can test it like so:

setInterval(function() {
    var footer = $('.' + datatable).find(".k-footer-template").html();
    if (footer.includes('$')) {
        $('.' + datatable).find(".k-footer-template").html(function(index, oldHtml) {
            return oldHtml.replace('$', '€');
        });
    }
}, 1000)

Thx it works, even if it is an ugly workaround.