【发布时间】:2020-05-15 08:17:51
【问题描述】:
我在下面有一个简单的示例,说明用户进入网站时的闪亮BS 模态弹出概念。这工作正常,现在突然停止工作。我有闪亮的服务器专业版。不仅模式不显示,而且数据表也没有呈现。就好像服务器端根本没有运行。我得到一个空白页。
library(shiny)
library(shinyBS)
library(DT)
ui <- fluidPage(
fluidRow(
bsModal(
id = 'startupModal',
title = h4('IMPORTANT NOTICE. MUST READ AND ACKNOWLEDGE!'),
trigger = '', size = 'large',
p('The system you are entering is proprietary ... Do not mess with us!')
)
),
fluidRow(
mainPanel(
DT::dataTableOutput('myData'),
width = 12
)
)
)
server <- function(input, output, session) {
toggleModal(session, "startupModal", toggle = "open")
output$myData <- DT::renderDataTable({
mtcars %>%
DT::datatable(
escape = FALSE, class = 'compact', rownames = '', filter = 'none'
)
})
}
shinyApp(ui, server)
如果我如下注释掉模态 UI,页面和数据表呈现正常。
library(shiny)
library(shinyBS)
library(DT)
ui <- fluidPage(
# fluidRow(
# bsModal(
# id = 'startupModal',
# title = h4('IMPORTANT NOTICE. MUST READ AND ACKNOWLEDGE!'),
# trigger = '', size = 'large',
# p('The system you are entering is proprietary ... Do not mess with us!')
# )
# ),
fluidRow(
mainPanel(
DT::dataTableOutput('myData'),
width = 12
)
)
)
server <- function(input, output, session) {
toggleModal(session, "startupModal", toggle = "open")
output$myData <- DT::renderDataTable({
mtcars %>%
DT::datatable(
escape = FALSE, class = 'compact', rownames = '', filter = 'none'
)
})
}
shinyApp(ui, server)
这里是关于包和 R 运行的更多信息:
R version 3.4.1 (2017-06-30) -- "Single Candle"
Copyright (C) 2017 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
Natural language support but running in an English locale
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> packageVersion('shiny')
[1] ‘1.4.0’
> packageVersion('shinyBS')
[1] ‘0.61’
> packageVersion('DT')
[1] ‘0.5’
shiny-server --version
Shiny Server Pro v1.5.12.1023
Node.js v10.15.3
我在 Chrome(包括启用弹出窗口的设置)和 Microsoft Edge 上都试过这个。它们都不起作用。
【问题讨论】:
-
好吧,看起来这是与最新版本闪亮的兼容性问题。 github.com/ebailey78/shinyBS/issues/112。有谁知道如何解决?是的,我可以降级闪亮的软件包版本,但不想养成这个习惯。