title: How to render column total (with javascript) when using grouped rows in reactable r package?
body: <p>I am using <code>crosstalk</code> in combination with <code>reactable</code>. In the table I use grouped rows. Now I need to add a column total, using javascript. </p>
  
  <pre><code>---
  title: "Focal Chart (Top)"
  output: 
    flexdashboard::flex_dashboard:
      orientation: rows
  ---
  
  Inputs {.sidebar}
  -------------------------------------
  
  ```{r}
  library(crosstalk)
  library(reactable)
  cars &lt;- MASS::Cars93[1:20, c("Manufacturer", "Model", "Type", "Price")]
  
  data &lt;- SharedData$new(cars)
  filter_checkbox("type", "Type", data, ~Type)
      filter_slider("price", "Price", data, ~Price, width = "100%")
      filter_select("mfr", "Manufacturer", data, ~Manufacturer)
  ```
  
  Row {data-height=500}
  -------------------------------------
  
  ### Chart 1
  
  ```{r}
  reactable(
    data,
    groupBy = "Manufacturer",
    searchable = TRUE,
  columns = list(
    Price = colDef(aggregated = JS("
        function(cellInfo) {
          // Calculate sum of all values in visible rows
          var values = cellInfo.subRows.map(function(row) { return row.Price})
          var total = values.reduce(function(a, b) { return a + b }, 0)
          return total.toFixed(1)
        }
      "),  footer = JS("function(colInfo) {
          var values = colInfo.data.map(function(row) { return row[colInfo.column.id] })
          var total = values.reduce(function(a, b) { return a + b }, 0)
          return '$' + total.toFixed(2)
        }")
      ),
      Manufacturer = colDef(footer = "Total")
    ),
    defaultColDef = colDef(footerStyle = list(fontWeight = "bold"))
  )
  ```
  
  Row {data-height=500}
  -------------------------------------
  
  ### empty
  
  ```{r}
  
  ```   
  
  ### empty
  
  ```{r}
  
  ```
  </code></pre>
  
  <p>As you can see, the column total is <strong>$NaN</strong>. Ofcourse this is an unwanted outcome. If I remove the <code>groupBy</code> parameter, the column total is <strong>$471.80</strong>, as it should be. Does anyone know how to fix this <code>groupBy</code> behaviour? Many thanks in advance!</p>