[英]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.