Closed novotny1akub closed 2 years ago
Hi @novotny1akub, You may try another (possibly updated) Greg's JS render function, works perfectly for me:
footer = JS("function(colInfo) {
let total = 0
colInfo.data.forEach(function(row) {
total += row[colInfo.column.id]
})
return '<b>$' + total.toFixed(2) + '</b>'
}")
@radovan-miletic works like a charm, thanks!
Sorry about that, this was probably because that example used a new feature in the unreleased development version (v0.2.3.9000), the new state
argument for header and footer render functions. I think it'd help to add a note like "this example requires v0.2.3.9000 (unreleased)" for any example that needs the development version, so I'll go through the docs and do that.
On a related note, reactable v0.3.0 was just released to CRAN, so that example should now work with the latest reactable on CRAN. And colInfo.data
was deprecated in favor of state.data
, although colInfo.data
will still work for a long time. So switch over to state.data
when you can, but it's not super urgent.
I tried to run the example for custom rendering, but it does not seem to be working. How can I edit the JS code so that it works? Thank you!![image](https://user-images.githubusercontent.com/39886440/170463565-2174460a-863a-4e97-b798-bb6be093035a.png)