How to disable a tabPanel in shinydashboard?

前端 未结 1 1567
孤街浪徒
孤街浪徒 2021-01-14 01:26

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 wa

相关标签:
1条回答
  • 2021-01-14 01:56

    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.

    0 讨论(0)
提交回复
热议问题