Is there a way to disable a tabPanel until an actionButton is clicked? I tried to do this using shinyjs but that did not work. Currently my ui.R has the following code. I want to disable 'Filter' tabPanel until loadButton is clicked. `
body <- dashboardBody(
useShinyjs(),
tabsetPanel(id = "tabs", type = 'pills',
tabPanel("Load", dataTableOutput("loadTab")),
tabPanel("Filter", id='filterTab',dataTableOutput("filteredResults"))
))
sidebar <- dashboardSidebar(
sidebarMenu(
selectInput(inputId = "datasetName",label = 'Dataset', choice=c('Cancer','Normal')),
actionButton("loadButton", label = "Load")
))
` Any help is appreciated.
I got it working with shinyjs. `
jsCode <- "
shinyjs.disableTab = function() {
var tabs = $('#tabs').find('li:not(.active) a');
tabs.bind('click.tab', function(e) {
e.preventDefault();
return false;
});
tabs.addClass('disabled');
}
shinyjs.enableTab = function(param) {
var tab = $('#tabs').find('li:not(.active):nth-child(' + param + ') a');
tab.unbind('click.tab');
tab.removeClass('disabled');
}
" ` And then enabling and disabling tabs as needed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With