问题描述
我需要在仪表板上添加天气信息。通常,标签$ iframe将用于此目的,但在仪表板中将无法使用。我使用了以下代码
server <-shinyServer(function(input,output,session) {
observe({
input$btn
session$sendCustomMessage(type = "resetFileInputHandler","file1")
})})
ui <-shinyUI(bootstrapPage(
dbHeader <- dashboardHeader(title = "",tags$li(a(href = '',icon(""),title = ""),class = "dropdown"),tags$li(a(href = 'https://www.redhat.com/en',img(src = '1.jpg',title = "redhat",height = "70px",style = "align:centre;"),style = "padding-top:5px; padding-bottom:5px;"),tags$li(a(href = 'https://ubuntu.com/',img(src = '2.png',title = "ubuntu",height = "70px"),(src = "https://forecast.io/embed/#lat=42.3583&lon=-71.0603&name=Boston"
),class = "dropdown")
),fileInput('file1','Choose File'),actionButton("btn","Trigger server to reset file input"),tags$script('
Shiny.addCustomMessageHandler("resetFileInputHandler",function(x) {
var id = "#" + x + "_progress";
var idBar = id + " .bar";
$(id).css("visibility","hidden");
$(idBar).css("width","0%");
});
')
))
预期输出
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)