title: R rhandsontable renderer does not follow column sorting despite being reactive
body: <p>I am working in a shiny app that displays a rhandsontable. I use a &quot;renderer&quot; to customize cell color and border. In addition, I would like to allow the user to perform column sorting. Here is my problem: when columns are sorted, the borders and the colors defined in the renderer do not follow the sorting. Indeed, they stay at the same position in the table, despite their coordinates are computed in a reactive code block. It looks like the sorting is not detected as a &quot;trigger&quot; of the reactive part. See for example the dummy reproducible example here below:</p>
  <pre><code>library(rhandsontable)
  library(shiny)
  border_width &lt;- 4
  border_col &lt;- &quot;green&quot;
  ui &lt;- fluidPage(
    rHandsontableOutput('table'),
  )
  server &lt;- function(input, output) {
    get_data &lt;- reactive({
      if(is.null(input$table)) {
        show_dt &lt;- mtcars
        show_dt[,&quot;cyl4&quot;] &lt;- show_dt$cyl == 4
      } else {
        show_dt &lt;- hot_to_r(input$table)
        show_dt[,&quot;cyl4&quot;] &lt;- as.logical(show_dt[,&quot;cyl4&quot;])
      }
      return(show_dt)
    })
    output$table &lt;- rhandsontable::renderRHandsontable({
      show_dt &lt;- get_data() 
      row_highlight &lt;- which( show_dt$cyl == 4)
      rows21 &lt;- which(show_dt$mpg &gt; 30) - 1
      col21 &lt;- which(colnames(show_dt) == &quot;mpg&quot;) -1 
      mycells &lt;- list()
      for(i in seq_along(rows21)) {
        mycells[[i]] &lt;- list(
          range = list(from = list(row = rows21[i], col = col21),
                       to = list(row = rows21[i], col = col21)),
          top = list(width = border_width, color = border_col),
          left = list(width = border_width, color = border_col),
          bottom = list(width = border_width, color = border_col),
          right = list(width = border_width, color = border_col))
      }
      rhandsontable(show_dt, height = 500, row_highlight=row_highlight-1) %&gt;%
        hot_cols(columnSorting = TRUE) %&gt;%
        hot_cols(renderer = &quot;
              function(instance, td, row, col, prop, value, cellProperties) {
                  Handsontable.renderers.TextRenderer.apply(this, arguments);
                  if (instance.params) {
                      hrows = instance.params.row_highlight
                      hrows = hrows instanceof Array ? hrows : [hrows]
                  }
                  if (instance.params &amp;&amp; hrows.includes(row)) td.style.background = '#FFC5C5';
              }&quot;)  %&gt;%  hot_col(col = &quot;cyl4&quot;,
                                renderer = &quot;
                function (instance, td, row, col, prop, value, cellProperties) {
                    Handsontable.renderers.CheckboxRenderer.apply(this, arguments);
                    if (value) {
                        td.style.background = '#FFC5C5';
                    } else {
                     td.style.background = '#C3FA9A';
                    }
                }
            &quot;) %&gt;% hot_table(customBorders = mycells)
      
    })
  }
  shinyApp(ui, server)
  </code></pre>
  <p>Does anyone has an explanation why it does not work as expected ? Do you know how I could make the  reactvive code block sensitive to column sorting (so that it re-calculates the correct positions upon sorting) ?</p>