我正在尝试selectizeGroupUI
在闪亮的模块中使用。似乎服务器功能工作正常,因为数据表显示在 UI 中,但selectizeGroupUI
无法访问其中的输入。
你能帮我解决一下吗?
library(shiny)
library(shinyWidgets)
library(dplyr)
library(DT)
library(data.table)
library(highcharter)
library(tidyverse)
library(shiny)
library(shinythemes)
library(shinydashboard)
library(scales)
library(shinyWidgets)
data("mpg", package = "ggplot2")
opt_in_dashboard_UI <- function(id) { fluidPage(
fluidRow(
column(
width = 10, offset = 1,
tags$h3("Filter data with selectize group"),
panel(
selectizeGroupUI(
id = "my-filters",
params = list(
manufacturer = list(inputId = "manufacturer", title = "Manufacturer:"),
model = list(inputId = "model", title = "Model:"),
trans = list(inputId = "trans", title = "Trans:"),
class = list(inputId = "class", title = "Class:")
)
), status = "primary"
),
DT::dataTableOutput(outputId = (NS(id,"table"))
)
)
))
}
#server <- function(input, output, session) {
opt_in_dashboard_Server <- function(id) {
moduleServer(id, function(input, output, session) {
res_mod <- callModule(
module = selectizeGroupServer,
id = "my-filters",
data = mpg,
vars = c("manufacturer", "model", "trans", "class")
)
output$table <- DT::renderDataTable(res_mod())
}
)}
ui <- fluidPage(
opt_in_dashboard_UI("opt_in_dashboard")
)
server <- function(input, output, session) {
opt_in_dashboard_Server("opt_in_dashboard")
}
shinyApp(ui, server)