Below is a code that activates user defined menu option during right click on any specific object. In this example plot.
library(shiny)
library(shinyBS)
library(shinyMenus)
app <- shinyApp(
ui =
fluidPage(
smNavBar("testMenu", "shinyMB", full.width = TRUE, fixed = FALSE,
textInput("n", "Sample Size", value = 1000)
),
plotOutput("testPlot"),
smContextMenu("context1","testPlot",
smAction("action1", "Normal"),
smAction("action2", "Lognormal"),
smAction("action3", "Uniform")
)
),
server =
function(input, output, session) {
output$testPlot <- renderPlot({
plot(rnorm(input$n))
})
})
runApp(app)
If I try to trigger the same functionality on a datatable it does not work.
library(shiny)
library(shinyBS)
library(shinyMenus)
app <- shinyApp(
ui = basicPage(
h2('The mtcars data'),
dataTableOutput('mytable'),
smContextMenu("context1","mytable",
smAction("action1", "Cat"),
smAction("action2", "Dog"),
smAction("action3", "Exotic Bird")
)
),
server =
function(input, output, session) {
output$mytable <- renderDataTable({
mtcars
})
})
runApp(app)
Not sure what I am missing, any help is much appriciated.
Below is a code that activates user defined menu option during right click on any specific object. In this example plot.
If I try to trigger the same functionality on a datatable it does not work.
Not sure what I am missing, any help is much appriciated.