Closed daranzolin closed 1 year ago
Yes, the problem is that in the footer
value, <b>Total</b>
isn't JavaScript but really HTML, so the browser fails to parse it as JavaScript. It should work if you remove JS()
(which marks it as a JavaScript expression) and use a plain character string:
data <- MASS::Cars93[14:38, c("Type", "Price", "MPG.city", "DriveTrain", "Man.trans.avail")]
reactable(
data,
groupBy = "Type",
columns = list(
Price = colDef(aggregate = "max"),
MPG.city = colDef(aggregate = "mean", format = colFormat(digits = 1)),
DriveTrain = colDef(aggregate = "unique"),
Man.trans.avail = colDef(aggregate = "frequency"),
Type = colDef(
html = TRUE,
footer = "<b>Total</b>"
)
)
)
Ah, makes sense, thank you!
I was hoping to include summary rows on a grouped/aggregate table, a la:
But this example fails with the error
Uncaught SyntaxError: Unexpected token '<'
in my browser console.Is it possible to have summary rows here?