我想对tx_news进行solr搜索,在其中可以键入搜索并选择其他标签。与复选框。在搜索之前。我尝试过方面
library(shiny)
library(shinydashboard)
# Define UI
ui <- fluidPage(
titlePanel("Identify Total amount/Divison"),
sidebarLayout(
sidebarPanel(
width = 12,
# Buttons to add/remove a question
actionButton("add", "Add Divison"),
actionButton("remove", "Remove Divison"),
div(id = "questions",
style = "border: 1px solid silver;")
),
mainPanel(
)))
# Define server logic
server <- function(input, output) {
values <- reactiveValues(num_questions = 0)
# Add a division
observeEvent(input$add, ignoreNULL = FALSE, ignoreInit = TRUE,{
values$num_questions <- values$num_questions + 1
num <- values$num_questions
#ui = tags$div(
# observe({
insertUI( immediate = TRUE,
selector = "#questions", where = "beforeEnd",
splitLayout(
cellWidths = c("20%","20%", "20%", "20%", "20%"),
cellArgs = list(style = "padding: 3px"),
id = paste0("question", num),
textAreaInput(inputId = paste0("Division_", num),
label = paste0(num, ". Division:"),
placeholder = "Placeholder"),
selectizeInput(inputId =paste0("Number_Product1_", num),
label = paste0("Product1"), isolate(seq(from = 50, to = 100000, by = 50)), multiple=FALSE,
selected = 50),
selectizeInput(inputId =paste0("Number_Product2_", num),
label = paste0("Product2"), isolate(seq(from = 0, to = 100000, by = 50)), multiple=FALSE),
box(
title = "Total", width = 12, background = "black",
print( input$Number_Product1_1),
textOutput("total")
), #### Input from selectizeInput "Product 1"
box(
title = "inputID", width = 12, background = "black",
paste0("Number_Product1_", num)) #### inputID's of the selectizeinput "Product 1"
))
#)
# })
})
#observe({
# require(input$Number_Product1_1)
output$total <- renderText({
input[["Number_Product1_1"]]
})
# })
# Remove a division
observeEvent(input$remove, {
num <- values$num_questions
# Don't let the user remove the very first Row
if (num == 1) {
return()
}
removeUI(selector = paste0("#question", num))
values$num_questions <- values$num_questions - 1
})
}
# Run the application
shinyApp(ui = ui, server = server)
} }
但是它们仅在搜索后显示以进行过滤。不是一开始。而且我也无法获取新闻标签