2016-05-17 9 views
4

Ich arbeite mit glänzenden zu tun Webanwendung, die Anwendung besteht aus einem Sidebarpanel auf der linken Seite des Mainpanels (mit 2 Tabs Panel) und einem anderen Sidebarpanel unten. Ich möchte die untere Seitenleiste für das erste Mainpanel behalten, aber für das zweite Mainpanel entfernen. Der Code wie folgt aussieht:Entfernen eines SidebarPanel für ein bestimmtes TabPanel

sidebarPanel(

    wellPanel(

     fileInput('file1', 'Choisissez les data service ?', 
       accept = c('text/csv', 'text/comma-separated-values', 
       'text/tab-separated-values', 'text/plain', 
       '.csv', '.tsv', 'RData' 
       ) 
    ) 


    ), 


    wellPanel(

     selectInput(inputId = "fonction.de", 
        label = "En fonction de ?", 
        choices = fonctions.de, 
        selected = "perimetre_commercial_estime" 
    ), 


     selectInput(inputId = "perimetre", 
        label = "Perimetres commercial", 
        choices = perimetres, 
        selected = "2-HDM MARCHAND", 
        multiple = TRUE 
    ), 

     checkboxInput(inputId = "case1", label = "Tous perimetres", value = FALSE), 


     selectInput(inputId = "ae", 
        label = "AE", 
        choices = aes, 
        selected = "AE Paris", 
        multiple = TRUE 
    ), 

     checkboxInput(inputId = "case2", label = "Tous AE", value = FALSE), 


     selectInput(inputId = "segment", 
        label = "Segment commercial", 
        choices = segments, 
        selected = "Premium", 
        multiple = TRUE 
    ), 

     checkboxInput(inputId = "case3", label = "Tous segments", value = FALSE) 





    ) 
), 

    mainPanel(

    tabsetPanel(type = "tabs", 
       tabPanel("Graphiques", 
         plotlyOutput("my.chart")), 
       tabPanel("Tables", 
         dataTableOutput("my.table"), 
         htmlOutput("my.text1")) 

    ) 
), 

    sidebarPanel(

    selectInput(inputId = "abscisse", 
       label = "Abscisse", 
       choices = abscisses, 
       selected = "", 
       multiple = FALSE 
    ), 


    selectInput(inputId = "ordonnee", 
       label = "Ordonnee", 
       choices = ordonnees, 
       selected = "", 
       multiple = FALSE 
    ) 

), 


    sidebarPanel(
    img(src="Dymetryyy.jpg", height = 150, width = 350) 
) 


) 
) 
+0

Conditionalpanel könnte den Job ich denke? –

Antwort

3

Für Menschen, die das gleiche Problem konfrontiert sind, müssen Sie conditionalPanel verwenden, es zu lösen.

mainPanel(

    tabsetPanel(id = "bab", 
       type = "tabs", 
       tabPanel(value = "graphiques", 
         "Graphiques", 
         plotlyOutput("my.chart")), 
       tabPanel(value = "tables", 
         "Tables", 
         dataTableOutput("my.table"), 
         htmlOutput("my.text1")) 

    ) 
), 

    conditionalPanel(condition = "input.bab == 'graphiques'", 
    sidebarPanel(

     selectInput(inputId = "abscisse", 
        label = "Abscisse", 
        choices = abscisses, 
        selected = "", 
        multiple = FALSE 
    ), 


     selectInput(inputId = "ordonnee", 
        label = "Ordonnee", 
        choices = ordonnees, 
        selected = "", 
        multiple = FALSE 
    ) 

    ), 


    sidebarPanel(
     img(src="dymetryyy", height = 150, width = 350) 
    ) 

) 
Verwandte Themen