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

not able to renderTable using yonder #201

Open
dangus-aktivbo opened this issue Sep 26, 2022 · 0 comments
Open

not able to renderTable using yonder #201

dangus-aktivbo opened this issue Sep 26, 2022 · 0 comments

Comments

@dangus-aktivbo
Copy link

dangus-aktivbo commented Sep 26, 2022

In this minimal example, you can try swapping UI-code in and out to see the problem.

#### SWAP IN THESE LINES - APP WILL THEN WORK...
# library(shinyWidgets)
# fluidPage(fluidRow(
#   column(width = 4,
#               uiOutput(outputId = 'ui_picker_chooseproject')
#          ),
# 
#   column(width = 4,
#          shiny::tableOutput(outputId = 'table'),
#   )#column
#   ))



#### THESE LINES FAILS TO RUN RENDERING FUNCTION
library(yonder)
webpage(
  nav = navbar(brand = 'Show table rows based on picker length'),
  yonder::container(
    yonder::columns(
      yonder::column(width = 4,
                     yonder::card(header = 'Choose projects',
                                  shiny::uiOutput(outputId = 'ui_picker_chooseproject')
                     )
      ),
      yonder::column(width = 4,
                     yonder::card(header = 'Choosen projects list',
                                  shiny::tableOutput(outputId = 'table')
                     )
      )
    )
  )
)

And the server :

library(dplyr)
library(shinyWidgets)

# Define server logic required to draw a histogram
server <- function(input, output, session) {
  df_pc <- reactive({
    data.frame(ProjectID = c(1, 2, 3, 4), ProjectName = c('a', 'b', 'c', 'd'))
  })
  output$ui_picker_chooseproject <- renderUI({
    pickerInput(inputId = 'picker', label = 'pick', multiple = TRUE,
                choices = setNames(df_pc()$ProjectID, df_pc()$ProjectName))
  })
  output$table <- renderTable({cars[1:length(input$picker), ]})
}
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