MichaelHogers / xSpreadsheet

RXSpreadsheet provides a wrapper for https://github.com/myliang/x-spreadsheet, a very nice web-based JavaScript canvas spreadsheet. RXSpreadsheet is a minimalistic wrapper.
https://michaelhogers.github.io/xSpreadsheet/
Other
28 stars 2 forks source link

row/col length set in options not respected #1

Open nanxstats opened 3 years ago

nanxstats commented 3 years ago

It looks like row and col set in options are not effective, although the other parameters are. I'm not sure if this is from upstream, but here is a minimal reproducible example:

library("shiny")
library("RXSpreadsheet")

ui <- fluidPage(
  RXSpreadsheetOutput(outputId = "example")
)

server <- function(input, output) {
  output$example <- RXSpreadsheet::renderRXSpreadsheet({
    df <- dataFrameListToList(list(
      "sheet1" = data.frame(matrix(rnorm(25), nrow = 5, ncol = 5))
    ))
    RXSpreadsheet(df, options = list(
      "showGrid" = FALSE,
      "row" = list("len" = 10),
      "style" = list(bgcolor = "#DDD")
    ))
  })
}

shinyApp(ui = ui, server = server)
Screen Shot 2020-12-09 at 11 47 47 AM

Thanks for creating the package.

MichaelHogers commented 3 years ago

Hi Nan,

Thank you for raising this issue. I have been doing a bit of testing and it seems that the actual javascript library works correctly with the len setting for row and col.

Upgrading the xspreadsheet.js file for RXSpreadsheet unfortunately did not do the trick. There might be an issue in the list to JSON conversion, I will check it later.

Best regards,

Michael