0

我正在使用库 shinyTree 和 shinyWidgets。问题是,如果我将分层复选框放在下拉模态上,双击树扩展图标(见下图中的红色圆圈)将关闭父下拉模态。

在此处输入图像描述

有什么解决方案吗?

完整源代码:

服务器.R

library(shiny)
library(shinyTree)
library(shinyWidgets)

shinyServer(function(input, output, session) {
  output$shinyTreeTest <- renderUI({ 
    dropdown(
      shinyTree("tree", checkbox = TRUE),
      style = "unite", label = "Location", width = "300px", circle=FALSE
    )
  })

  output$tree <- renderTree({ 
    list(  'I lorem impsum'= list( 
      'I.1 lorem impsum'   =  structure(list('I.1.1 lorem impsum'='1', 'I.1.2 lorem impsum'='2'),stselected=TRUE),  
      'I.2 lorem impsum'   =  structure(list('I.2.1 lorem impsum'='3'), stselected=TRUE)))

  })
})

用户界面

library(shiny)
library(shinyTree)

shinyUI(
  shiny::fluidPage(
    h4('Shiny hierarchical checkbox')
    ,uiOutput("shinyTreeTest")
  )
)
4

1 回答 1

1

I also posted this question on GitHub shinyWidget project and got the answer from there. The problem has been solved by reinstalling shinyWidget from devtool rather than CRAN.

于 2018-07-15T20:56:56.297 回答