Skip to content

Problem with htbale rows and cols #23

@buco

Description

@buco

Hello,

I have a problem with the correct number of columns.
Here is the ui.R

library(shiny)
library(shinyTable)

' Define UI for application that demonstrates a simple Handsontable

' @author Jeff Allen \email{jeff@@trestletech.com}

shinyUI(pageWithSidebar(

Application title

headerPanel("Simple Shiny Table!"),

sidebarPanel(
helpText(HTML("A simple editable matrix.

Created using <a href = "http://github.com/trestletech/shinyTable\">shinyTable."))
),

Show the simple table

mainPanel(
htable("tbl")
)
))

##### Here is the server.R

library(shiny)
library(shinyTable)

' Define server logic required to generate simple table

' @author Jeff Allen \email{jeff@@trestletech.com}

shinyServer(function(input, output, session) {
cachedTbl <- NULL

output$tbl <- renderHtable({
if (is.null(input$tbl)){
rows <- 10
# Seed the element with some data initially
tbl <- round(matrix(rnorm(54,100),ncol=3,nrow=18), 0)

  # So RJSONIO clips numeric data after a few digits? 'Cause why would
  # anyone want more than a few digits of resolution anyways?
  # (Can we get a real JSON parser for R yet?) </rant>

  cachedTbl <<- tbl
  print(tbl)
  return(tbl)
} else{
  cachedTbl <<- input$tbl
  print(input$tbl)
  return(input$tbl)
}

})
})

I get a 18×18 matrix in which only the first 3 columns contain data.

Any idea?

Thank you for you help!

Best wishes,
Robert

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions