在R

时间:2018-02-28 08:04:00

标签: r shiny shinydashboard shinyapps

在下面给出的R闪亮脚本中,我正在尝试使用带有Picker Input闪亮小部件的条件面板。在选择" times"时,pickerInput中有三个选项。选项,我希望使用条件面板创建新的pickerInputs,使用selectInput可以实现以下功能,但我需要对Picker Input使用相同的选项。谢谢,请帮助。

library(shiny)
library(shinydashboard)
ui <- dashboardPage(
dashboardHeader(title = "Picket",titleWidth = 290),
dashboardSidebar(width = 0),
dashboardBody(
tabsetPanel(type = "tab",
            tabPanel("Overview", value = 1,

                     box(
                       column(1, 
                              dropdown(
                                pickerInput(inputId = "resources", 
                                            label = "", 
                                            choices = c("cases", 
                                                        "activities", 
                                                        "times"), 
                                            choicesOpt = list(icon = c("fa fa-bars", 
                                                                       "fa fa-bars", 
                                                                       "fa fa-safari")), 
                                            options = list(`icon-base` = "")),
                                circle = FALSE, status = "primary", icon = icon("list", lib = "glyphicon"), width = "300px"
                              ),
                              conditionalPanel(
                                condition = "input.Position == 'times' ",
                                dropdown(
                                pickerInput(inputId = "Id072", 
                                            label = "Select/deselect all options", 
                                            choices = c("A","Check-out", "b","c","d","e","f")
                                            )))))),

id= "tabselected"

            )

            ))


server <- function(input, output) { 
}
shinyApp(ui, server)

1 个答案:

答案 0 :(得分:2)

condition = "input.Position == 'times' ", condition = "input.resources == 'times' ",不应该是@if ($paginator->hasPages()) <ul class="pagination"> {{-- Previous Page Link --}} @if ($paginator->onFirstPage()) <li class="page-item disabled"> <a class="page-link" href="#" aria-label="Previous"> <span aria-hidden="true">&laquo;</span> <span class="sr-only">Previous</span> </a> </li> @else <li class="page-item"><a href="{{ $paginator->previousPageUrl() }}" class="page-link" rel="prev">&laquo;</a></li> @endif {{-- Pagination Elements --}} @foreach ($elements as $element) {{-- "Three Dots" Separator --}} @if (is_string($element)) <li class="page-item disabled">{{ $element }}</li> @endif {{-- Array Of Links --}} @if (is_array($element)) @foreach ($element as $page => $url) @if ($page == $paginator->currentPage()) <li class="page-item active"> <a href="#" class="page-link">{{ $page }}<span class="sr-only">(current)</span></a> </li> @else <li class="page-item"> <a href="{{ $url }}" class="page-link">{{ $page }}</a> </li> @endif @endforeach @endif @endforeach {{-- Next Page Link --}} @if ($paginator->hasMorePages()) <li class="page-item"><a href="{{ $paginator->nextPageUrl() }}" class="page-link" rel="next">&raquo;</a></li> @else <li class="page-item disabled"> <a class="page-link" href="#" aria-label="Next"> <span aria-hidden="true">&raquo;</span> <span class="sr-only">Next</span> </a> </li> @endif </ul> @endif