0

I want to freeze the header and(or) the first column of the table as what we can do easily in Excel when using renderDataTable in shiny. I guess we can plug in the extensions of dataTable in the link below: http://datatables.net/extensions/fixedcolumns/

But I don't know much about java, can anybody provide an example about implementing the extensions in shiny? Thanks a lot.

Yihui Xie
  • 28,913
  • 23
  • 193
  • 419
Jie
  • 115
  • 2
  • 6

1 Answers1

1

Mayb using googleVis package can be of help

library(shiny)
library(googleVis)
runApp(
  list(ui = pageWithSidebar(
    headerPanel("googleVis on Shiny"),
    sidebarPanel(
      selectInput("dataset", "Choose a data:",
                  choices = c("rock", "pressure", "cars"))
    ),
    mainPanel(
      htmlOutput("table")
          )
  ),
  server =function(input, output)({
    output$table <- renderGvis({
      ## Table with enabled paging
      tbl2 <- gvisTable(Population, options=list(page='enable', height=300, alternatingRowStyle = T), chartid = "mytable")
      tbl2
    })    
  })
  )
)
Keniajin
  • 1,649
  • 2
  • 20
  • 43
  • Is there any possible to use the datatables extensions in http://datatables.net/extensions/fixedcolumns/ directly? It looks quite fancy. – Jie Jan 16 '15 at 16:50
  • may br you can a `javascript ` provided to the app check http://stackoverflow.com/questions/23599268/include-a-javascript-file-in-shiny-app – Keniajin Jan 16 '15 at 19:07
  • 1
    Thank you Keniajin, I will follow the instructions in the link and try to implement the java script in Shiny. Thanks. – Jie Jan 27 '15 at 15:50