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 · 1 comment
Open

not able to renderTable using yonder #201

dangus-aktivbo opened this issue Sep 26, 2022 · 1 comment

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), ]})
}
@nteetor
Copy link
Owner

nteetor commented Oct 31, 2024

When you noticed the problem, the table wasn't rendering at all? Using both UIs provided I was able to see the rendered table and adjust the table via the picker input. I realize it's been a couple years since you opened this issue.

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

2 participants