2

I am trying to hide columns in a rhandsontable rendered in a Shiny app. I believe that in the current version it can't be done as explained here. However Handsontable does have a Hidden Columns plugin. I am not conversant with how to add plugins. If someone can show me, that would be great.

I am trying a css based approach but that's also failing. In my ui.R, I render the table using rHandsontableOutput("CargoListData"). This table CargoListData has 19 columns and I wish to hide the 18th column. It's a timestamp that I don't wish to display to the user, but I do need it in calculations when the user edits the table and saves it.

I have been trying to hide the column using some css code in my styles.css file of the Shiny app :

#CargoListData > * > td:nth-child(18) {
    display: none;
}

However this has no effect on hiding the column. What am I doing wrong?

Dhiraj
  • 1,650
  • 1
  • 18
  • 44

1 Answers1

1

Since all else failed, here's something I discovered which handles this problem at least for now. My rhandsontable has 19 columns and I wish to hide the 17th to 19th columns. Specifying colWidths as 0.1 (and not 0) solves this.

hot_cols(colWidths = c(rep(150,16),rep(0.1,3)))
Dhiraj
  • 1,650
  • 1
  • 18
  • 44