cal_proxy_options {toastui}R Documentation

Set calendar's options with Proxy

Description

This function allow to set options for a calendar.

Usage

cal_proxy_options(proxy, ...)

Arguments

proxy

A calendar_proxy() htmlwidget object.

...

Options for the calendar, you can use arguments from calendar(), cal_month_options() (under the form month = list(...)), cal_week_options() (under the form week = list(...))

Value

A calendar_proxy object.

See Also

Other calendar proxy methods: cal_proxy_clear(), cal_proxy_clear_selection(), cal_proxy_toggle(), cal_proxy_view(), calendar-proxy-navigate, calendar-proxy-schedule, calendar_proxy()

Examples


library(shiny)
library(toastui)

ui <- fluidPage(
  fluidRow(
    column(
      width = 4,
      checkboxInput(
        inputId = "narrowWeekend",
        label = "narrowWeekend ?",
        value = FALSE
      ),
      checkboxInput(
        inputId = "workweek",
        label = "workweek ?",
        value = FALSE
      )
    ),
    column(
      width = 8,
      calendarOutput("mycal")
    )
  )
)

server <- function(input, output, session) {
  
  output$mycal <- renderCalendar({
    calendar(cal_demo_data(), view = "month")
  })
  
  observeEvent(input$narrowWeekend, {
    cal_proxy_options("mycal", month = list(narrowWeekend = input$narrowWeekend))
  })
  
  observeEvent(input$workweek, {
    cal_proxy_options("mycal", month = list(workweek = input$workweek))
  })
}

if (interactive())
  shinyApp(ui, server)


[Package toastui version 0.3.3 Index]