r语言 - 启用/禁用不使用 flexdashboard+shinyjs



我知道这个问题,它显然已经解决了,但是我已经仔细检查了我得到了相关软件包的最新版本,disabledisabled似乎都不起作用。

最小示例:

---
title: "test"
runtime: shiny
output: 
flexdashboard::flex_dashboard
---
```{r global, include=FALSE}
library(shiny)
library(shinyjs)
library(flexdashboard)
```
```{r}
print(sessionInfo())
disabled(checkboxGroupInput("a", label = "heck", choices = 1:3))
disable(id = "a")
```

会议信息:

R version 3.6.0 (2019-04-26)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17763)
Matrix products: default
locale:
[1] LC_COLLATE=English_United Kingdom.1252 
[2] LC_CTYPE=English_United Kingdom.1252   
[3] LC_MONETARY=English_United Kingdom.1252
[4] LC_NUMERIC=C                           
[5] LC_TIME=English_United Kingdom.1252    
attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     
other attached packages:
[1] flexdashboard_0.5.1.1 shinyjs_1.0           shiny_1.3.2          
loaded via a namespace (and not attached):
[1] Rcpp_1.0.2      digest_0.6.21   later_0.8.0     mime_0.7       
[5] R6_2.4.0        jsonlite_1.6    xtable_1.8-4    magrittr_1.5   
[9] evaluate_0.14   stringi_1.4.3   promises_1.0.1  rmarkdown_1.15 
[13] tools_3.6.0     stringr_1.4.0   httpuv_1.5.2    xfun_0.9       
[17] yaml_2.2.0      compiler_3.6.0  htmltools_0.3.6 knitr_1.25     

有人发布并删除了评论,说我需要使用shinyjs::useShinyjs()这几乎是正确的,尽管准确地说,它需要useShinyjs(rmd = TRUE)。如果OP看到这一点,请随时发布作为答案,以便获得适当的信用。

最新更新