forked from dreamRs/shinyWidgets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
updateAwesomeCheckboxGroup.Rd
80 lines (60 loc) · 1.76 KB
/
updateAwesomeCheckboxGroup.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/input-awesomecheckbox.R
\name{updateAwesomeCheckboxGroup}
\alias{updateAwesomeCheckboxGroup}
\title{Change the value of a AwesomeCheckboxGroup input on the client}
\usage{
updateAwesomeCheckboxGroup(session, inputId, label = NULL, choices = NULL,
selected = NULL, inline = FALSE, status = "primary")
}
\arguments{
\item{session}{The session object passed to function given to shinyServer.}
\item{inputId}{The id of the input object.}
\item{label}{Input label.}
\item{choices}{List of values to show checkboxes for.}
\item{selected}{The values that should be initially selected, if any.}
\item{inline}{If TRUE, render the choices inline (i.e. horizontally)}
\item{status}{Color of the buttons.}
}
\description{
Change the value of a AwesomeCheckboxGroup input on the client
}
\examples{
\dontrun{
if (interactive()) {
library("shiny")
library("shinyWidgets")
ui <- fluidPage(
awesomeCheckboxGroup(
inputId = "somevalue",
choices = c("A", "B", "C"),
label = "My label"
),
verbatimTextOutput(outputId = "res"),
actionButton(inputId = "updatechoices", label = "Random choices"),
textInput(inputId = "updatelabel", label = "Update label")
)
server <- function(input, output, session) {
output$res <- renderPrint({
input$somevalue
})
observeEvent(input$updatechoices, {
updateAwesomeCheckboxGroup(
session = session, inputId = "somevalue",
choices = sample(letters, sample(2:6))
)
})
observeEvent(input$updatelabel, {
updateAwesomeCheckboxGroup(
session = session, inputId = "somevalue",
label = input$updatelabel
)
}, ignoreInit = TRUE)
}
shinyApp(ui = ui, server = server)
}
}
}
\seealso{
\code{\link{awesomeCheckboxGroup}}
}