superset icon indicating copy to clipboard operation
superset copied to clipboard

[Dashboard] Landing on specific tabs from URL

Open hughhhh opened this issue 7 years ago • 3 comments

I want to be able to land on specific dashboard tab, based upon the url params. For instance, give this url superset/dashboards/2?tab=3

The user should be able to land on this specific tab after entering this link in the browser.

Problems:

  • What if there is multiple tabs in a dashboard? How would know which tab to set?

hughhhh avatar Mar 25 '19 20:03 hughhhh

If you know javascript, try to run this script after necessary modification `function selectTab(){

//collect your URL parameter
    var objParam = new URLSearchParams(window.location.search);
    var tabParam = objParam.get('tab');
    var tabName = "";
//tab name is the value showing on each tab. 
    if(!tabParam) return false;

    if(tabParam =="3"){
        tabName = "Overview";
    } else if(tabParam=="k"){
        tabName = "KPI";
    } else if (tabParam == "s"){
        tabName = "Sales";
    }

        $('ul.nav.nav-tabs li a').children().find("input").each(function(){

            if($(this).val()==tabName){
                $(this).trigger("click");
             }

        });

}`

bvpillai avatar Mar 26 '19 13:03 bvpillai

related to #6964 @graceguo-supercat is working on it.

kristw avatar Mar 27 '19 23:03 kristw

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue .pinned to prevent stale bot from closing the issue.

stale[bot] avatar May 27 '19 00:05 stale[bot]