datagrid-shiny {toastui}R Documentation

Shiny bindings for datagrid()

Description

Output and render functions for using datagrid() within Shiny applications and interactive Rmd documents.

Usage

datagridOutput(outputId, width = "100%", height = "400px")

renderDatagrid(expr, env = parent.frame(), quoted = FALSE)

renderDatagrid2(expr, env = parent.frame(), quoted = FALSE)

datagridOutput2(outputId, width = "100%", height = "auto")

Arguments

outputId

Output variable to read from.

width, height

Must be a valid CSS unit (like ⁠100%⁠, ⁠400px⁠, auto) or a number, which will be coerced to a string and have px appended.

expr

An expression that generates a calendar

env

The environment in which to evaluate expr.

quoted

Is expr a quoted expression (with quote())? This is useful if you want to save an expression in a variable.

Value

Output element that can be included in UI. Render function to create output in server.

Special inputs

The following input values will be accessible in the server:

These other inputs can be defined using other functions:

Examples

library(shiny)
library(toastui)

ui <- fluidPage(
  tags$h2("datagrid shiny example"),
  tabsetPanel(
    tabPanel(
      title = "Fixed height",
      datagridOutput("default"),
      tags$b("CHECK HEIGHT")
    ),
    tabPanel(
      title = "Full height",
      datagridOutput("fullheight", height = "auto"),
      tags$b("CHECK HEIGHT")
    ),
    tabPanel(
      title = "Pagination",
      datagridOutput("pagination", height = "auto"),
      tags$b("CHECK HEIGHT")
    )
  )
)

server <- function(input, output, session) {

  output$default <- renderDatagrid({
    datagrid(rolling_stones_500)
  })

  output$fullheight <- renderDatagrid({
    datagrid(rolling_stones_500, bodyHeight = "auto")
  })

  output$pagination <- renderDatagrid({
    datagrid(rolling_stones_500, pagination = 15)
  })

}

if (interactive())
  shinyApp(ui, server)

[Package toastui version 0.3.3 Index]