-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathcalendar-proxy-schedule.Rd
91 lines (78 loc) · 2.31 KB
/
calendar-proxy-schedule.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
81
82
83
84
85
86
87
88
89
90
91
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/calendar-proxy.R
\name{calendar-proxy-schedule}
\alias{calendar-proxy-schedule}
\alias{cal_proxy_add}
\alias{cal_proxy_delete}
\alias{cal_proxy_update}
\title{Create / Update / Delete schedule(s) with Proxy}
\usage{
cal_proxy_add(proxy, value)
cal_proxy_delete(proxy, value)
cal_proxy_update(proxy, value)
}
\arguments{
\item{proxy}{A \code{\link[=calendar_proxy]{calendar_proxy()}} \code{htmlwidget} object.}
\item{value}{A \code{list} with schedules data.}
}
\value{
A \code{calendar_proxy} object.
}
\description{
These functions allow to create new schedule(s), update existing
ones and delete schedule in a calendar within the server in a Shiny application.
}
\note{
Those functions are intended to be used with corresponding input value:
\itemize{
\item \verb{input$<outputId>_add}: triggered when a schedule is added on calendar via creation popup.
\item \verb{input$<outputId>_update}: triggered when an existing schedule is edited.
\item \verb{input$<outputId>_deleted}: triggered when a schedule is deleted.
}
}
\examples{
library(shiny)
library(toastui)
ui <- fluidPage(
tags$h2("Add, Update and Delete schedule interactively"),
tags$p(
"Click on the calendar to create a new schedule",
"then you will be able to edit or delete it."
),
calendarOutput("my_calendar")
)
server <- function(input, output) {
output$my_calendar <- renderCalendar({
cal <- calendar(
defaultDate = Sys.Date(),
navigation = TRUE,
isReadOnly = FALSE,
useCreationPopup = TRUE
)
})
observeEvent(input$my_calendar_add, {
str(input$my_calendar_add)
cal_proxy_add("my_calendar", input$my_calendar_add)
})
observeEvent(input$my_calendar_update, {
str(input$my_calendar_update)
cal_proxy_update("my_calendar", input$my_calendar_update)
})
observeEvent(input$my_calendar_delete, {
str(input$my_calendar_delete)
cal_proxy_delete("my_calendar", input$my_calendar_delete)
})
}
if (interactive())
shinyApp(ui = ui, server = server)
}
\seealso{
Other calendar proxy methods:
\code{\link{cal_proxy_clear}()},
\code{\link{cal_proxy_options}()},
\code{\link{cal_proxy_toggle}()},
\code{\link{cal_proxy_view}()},
\code{\link{calendar-proxy-navigate}},
\code{\link{calendar_proxy}()}
}
\concept{calendar proxy methods}