简体   繁体   English

单击取消全选时如何显示文本输出?

[英]How do I display a text output when I click deselect all?

For my shiny app, I am using a pickerInput.对于我闪亮的应用程序,我使用的是pickerInput。 When "deselect all" is selected, the output of my datatable shows an error. When "deselect all" is selected, the output of my datatable shows an error. I am looking to print a string that says " Make sure to select an option!"我正在寻找打印一个字符串,上面写着“确保选择一个选项!” when deselect all is selected.当取消全选时。 Do I have to use observeEvent, or can I use an if statement in my server code?我必须使用observeEvent,还是可以在我的服务器代码中使用if 语句?

Here is an example of the pickerInput code: pickerInput("type", "Select Option", choices = c("a","b","c", "d"), selected = c("a","b","c","d"), options = list('actions-box' = TRUE), multiple = T)这是 pickerInput 代码的示例: pickerInput("type", "Select Option", choices = c("a","b","c", "d"), selected = c("a","b","c","d"), options = list('actions-box' = TRUE), multiple = T)

Here is an example of the server code: output$one<- DT::renderDT({DT::datatable(caption = "table", options = list(pageLength = 50),tab1<- rbind(red, blue,green, yellow)%>% filter(num> .450, letter == input$type))这是服务器代码的示例: output$one<- DT::renderDT({DT::datatable(caption = "table", options = list(pageLength = 50),tab1<- rbind(red, blue,green, yellow)%>% filter(num> .450, letter == input$type))

如果出错,您可以隐藏数据表或返回 NULL 并通过 shinyalert 显示消息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何根据计算结果在 Shiny 中显示文本 output? - How do I display text output in Shiny depending on the result of a caluclation? 当 Output 很大时,如何在 Rstudio 控制台中查看所有 Output - How Do I View All Output in Rstudio Console When the Output is Large 当 output 是来自代码块的文本时,如何在 Rmarkdown 中的每个注释之间添加一个空格? - How do I add a space between each comment in Rmarkdown when the output is text from a code chunk? 当我在R中的其他位置单击时,如何单击传单地图,创建标记,然后删除该标记 - How do I click on a leaflet map, create a marker, and then delete that marker when I click elsewhere in R 如何按倍数缩放 ggplot 中的所有文本? - How do I scale all the text in a ggplot by some multiple? 如何使用正则表达式和字符串从文本中删除所有问题? - How do I remove all questions from a text with regex and stringr? 编织时如何将输出发送到控制台而不是文档 - How do I send output to the console instead of a document when knitting 如何抑制此输出? - How do I suppress this output? 如何获取我在RStudio中运行的脚本的所有输出 - How do I get all the output from script I am running in RStudio 如何从代码块中的数据框中获取数字(或文本)到 RMarkdown html 输出中的文本? - How do I get a number (or text) from a data frame in a code chunk in to text in RMarkdown html output?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM