Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 138163

Use eventClick in FullCalendar (in Shiny)

$
0
0

I have a fullcalendar in shiny that I would like to incorporate "eventClicks" into. Ideally, I would like for additional information to be shown in a pop up/hover over text box when clicking on one of the events within the calendar.

# CALENDAR
 LOL1 <- reactive({
 data1 <- calendar_subset()
 data1$CAL_DATE2 <- format(as.Date(data1$CAL_DATE2, format = "%m/%d/%Y"))
 hope0 <- c(as.character(data1$Account_Num))
 hope1 <- c(as.character(data1$Billing_Num))
 hope2 <- c(data1$CAL_DATE2)
 hope3 <- c(as.character(data1$color))
 hope4 <- c(data1$Transaction_Amt2)
 fullcalendar(events = data.frame(
  title = c(hope0),
  start = c(hope2), 
  color = c(hope3),
  description = c(hope4)), 
options = list(header = list(left = "",center = "",right = "prev,next")),
callbacks = list(dayClick = DT::JS("function(event, jsEvent, view) {alert('Clicked on: ' + date.format());}")))
}) 

output$test <- renderFullcalendar({LOL1()})

Ultimately, I would like to replace the "dayClick" in the code above with an "eventClick" or "eventrender".

Any ideas?

Browser console error:

(index):1 Uncaught SyntaxError: missing ) after argument list
at Object.window.HTMLWidgets.evaluateStringMember (htmlwidgets.js:735)
at exports.OutputBinding.shinyBinding.renderValue (htmlwidgets.js:496)
at exports.OutputBinding.onValueChange (output_binding.js:16)
at exports.OutputBinding.delegator.<computed> [as onValueChange] (htmlwidgets.js:112)
at OutputBindingAdapter.onValueChange (output_binding_adapter.js:21)
at ShinyApp.receiveOutput (shinyapp.js:332)
at ShinyApp.<anonymous> (shinyapp.js:544)
at ShinyApp._sendMessagesToHandlers (shinyapp.js:529)
at ShinyApp.dispatchMessage (shinyapp.js:515)
at WebSocket.c.onmessage (shinyapp.js:112)

from the following code:

callbacks = list(eventClick = DT::JS("function(event, element, view) 
{alert('Billing Number: ' + event.billnum + '\\n'' + 'Amount: ' + 
event.amount);}")))

Viewing all articles
Browse latest Browse all 138163

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>