Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with htbale rows and cols #23

Open
buco opened this issue Jun 15, 2015 · 1 comment
Open

Problem with htbale rows and cols #23

buco opened this issue Jun 15, 2015 · 1 comment

Comments

@buco
Copy link

buco commented Jun 15, 2015

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

@catarinawor
Copy link

I have the same problem. But it goes away once I start inputting data on the matrix. Any suggestions on how to fix it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants