Skip to content
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

rpivotTable is not working together with shinyjqui #119

Open
derekzoutendijk opened this issue Nov 2, 2021 · 0 comments
Open

rpivotTable is not working together with shinyjqui #119

derekzoutendijk opened this issue Nov 2, 2021 · 0 comments

Comments

@derekzoutendijk
Copy link

Hi,

I found the following issue: When having a rpivotTable within your shiny app, the selectable in my shiny app no longer observes an event.

Reproduction:

  1. Run the code below
  2. Click one of the boxes within startpageDiv
    Result: The observe does not print the selected div (NOK)
  3. Comment the rpivotTableOutput
  4. Run again code and click one of the boxes
    Result: Observe does print selected div (OK)
    Note: When running in the browser and I press f12, I do see that the elements change to selected (even in combination with the pivot table)

####### Example code

library(shiny)
library(shinydashboard)
library(shinyBS)
library(shinyjs)
library(shinyjqui)
library(shinyWidgets)
library(rpivotTable)
library(tidyverse)

server <- function(input, output) {
observeEvent(input$startPageDiv_selected,
{
selected <- input$startPageDiv_selected %>% slice(1) %>% pull(text)
print(selected)

             output$PivotTest <- renderRpivotTable({
               rpivotTable(data.frame(test1 = c("a", "b", "c"), test2 = c(1,2,3)))
             })
           })

}

ui <- fluidPage(
fluidRow(
rpivotTableOutput('PivotTest')
),
fluidRow(
jqui_selectable(div(id="startPageDiv",
column(4,
div(id = "Ex1",
box(title = "Ex1", width="100%", height = "200px",
status = "danger",
solidHeader = TRUE,
h3("First")
))
),
column(4,
div(id = "Ex2",
box(title = "Ex2", width="100%", height = "200px",
status = "success",
solidHeader = TRUE,
h3("Second")
))
),
column(4,
div(id = "Ex3",
box(title = "Ex3", width="100%", height = "200px",
status = "info",
solidHeader = TRUE,
h3("Third")
))
)
))
)
)

shinyApp(ui, server)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant