Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

177
Visualizações
How to use checkbox:nth-child with inline checkboxGroupInput?

In following this question if the checkboxGroupInput has inline=TRUE then disable(selector="#a .checkbox:nth-child(1) label") will no longer disable the option. Is there a tweak to the selector string? I tried changing it to checkbox-inline but that didn't work.

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

With the inline=TRUE parameter, the label elements are not under a div, therefore you can make the reference directly to the labels.

library(shiny)

ui <- shinyUI(fluidPage(
  shinyjs::useShinyjs(),
  checkboxGroupInput("a", "A", choices = 1:7, inline = TRUE)
))

server <- shinyServer(function(input, output, session) {
  observeEvent(input$a, shinyjs::disable(selector="#a label:nth-child(1)"))
})

shinyApp(ui, server)
about 4 years ago · Juan Pablo Isaza Relatório

0

Sure, you just have to adjust the JS query collector. Try to adjust this accordingly

subElement <- paste0("#a .checkbox-inline:nth-child(", newSelection,") input")
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda