updateEditableInput: Change the value of an in-place editable input on the client

Description Usage Arguments Examples

Description

Change the value of an in-place editable input on the client

Usage

1
updateEditableInput(session, inputId, value = NULL)

Arguments

session

The session object passed to function given to shinyServer.

inputId

The id of the input object.

value

The value to set for the input object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## Only run examples in interactive R sessions
if (interactive()) {

ui <- fluidPage(
  editableInput("foo", "text", ""),
  actionButton("update", "Update"),
  verbatimTextOutput("bar")
)

server <- function(input, output, session) {
  output$bar <- renderPrint(input$foo)
  observeEvent(input$update, {
    updateEditableInput(session, "foo", sample(month.abb, 1))
  })
}

shinyApp(ui, server)

}

Yang-Tang/shinyEditable documentation built on May 4, 2019, 7:42 p.m.