-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cal_events function example not working #41
Comments
Hello,
Here's a complete example : library(shiny)
library(toastui)
calendarProps <- data.frame(
id = paste0("cal_", 1:3),
name = c("TODO", "Meetings", "Tasks"),
color = c("#FFF", "#FFF", "#000"),
backgroundColor = c("#E41A1C", "#377EB8", "#4DAF4A"),
borderColor = c("#a90000", "#005288", "#0a7f1c")
)
n <- 20
date_start <- sample(
seq(from = as.POSIXct(Sys.Date()-14), by = "1 hour", length.out = 24*7*4),
n, TRUE
)
date_end <- date_start + sample(1:25, n, TRUE) * 3600
schedules <- data.frame(
id = paste0("event_", 1:n),
calendarId = paste0("cal_", sample(1:3, n, TRUE)),
title = LETTERS[1:n],
body = paste("Body schedule", letters[1:n]),
start = format(date_start, format = "%Y-%m-%d %H:00:00"),
end = format(date_end, format = "%Y-%m-%d %H:00:00"),
category = sample(c("allday", "time", "task"), n, TRUE),
stringsAsFactors = FALSE
)
ui <- fluidPage(
tags$h2("Custom click event"),
fluidRow(
column(
width = 8,
calendarOutput(outputId = "cal")
),
column(
width = 4,
verbatimTextOutput(outputId = "res_click")
)
)
)
server <- function(input, output, session) {
output$cal <- renderCalendar({
calendar(useDetailPopup = FALSE) %>%
cal_props(calendarProps) %>%
cal_schedules(schedules) %>%
cal_events(
clickSchedule = JS("function(event) {Shiny.setInputValue('click', event)}")
)
})
output$res_click <- renderPrint(input$click)
}
if (interactive())
shinyApp(ui, server) I will update the documentation accordingly. Victor |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
I ran the example for the cal_events function, which includes:
... but no alert is created upon a schedule-click event.
Expected Behavior
An alert should appear upon a schedule-click event. The alert should show the event id.
Current Behavior
No alert.
Steps to Reproduce
Simply run the example for the cal_events function
Context
I'm trying to debug an issue with
cal_proxy_update()
, and I was hoping to use:to make sure that I'm using the correct id for the list object that must be provided as the
value
param to thecal_proxy_update()
function. However, I ran into this issue.Your Environment
The text was updated successfully, but these errors were encountered: