grid_proxy_add_row {toastui} | R Documentation |
Add rows to an existent datagrid
Description
Add rows to an existent datagrid
Usage
grid_proxy_add_row(proxy, data)
Arguments
proxy |
A |
data |
|
Value
A datagrid_proxy
object.
See Also
Other datagrid proxy methods:
datagrid_proxy()
,
grid_proxy_delete_row()
Examples
library(shiny)
library(toastui)
ui <- fluidPage(
tags$h2("Append row to grid"),
datagridOutput("grid"),
actionButton(
inputId = "add",
label = "Add row",
class = "btn-block"
)
)
server <- function(input, output, session) {
dat <- data.frame(
character = month.name,
select = month.name,
checkbox = month.abb,
radio = month.name,
password = month.name
)
output$grid <- renderDatagrid({
datagrid(rolling_stones_50[1, ])
})
value <- reactiveVal(1)
observeEvent(input$add, {
row <- value() + 1
grid_proxy_add_row(
proxy = "grid",
data = rolling_stones_50[row, ]
)
value(row)
})
}
if (interactive())
shinyApp(ui, server)
[Package toastui version 0.3.3 Index]