Select filter based on URL parameter

I have a page with a table component that has multiple filter tabs. I’d like to send a user to this page with a specific tab selected (that is different from the default tab) Is this possible? I’m thinking maybe a URL parameter and some custom Javascript?

Thanks in advance.

@Marty, see if this helps:

Example URL:
https://localtest.tadabase.io/real-estate-app-9/sample-page?filter=contact

This will only work if you have the #! in the domain settings of the app set to be removed.

Change the component_id and tab names accordingly.

var loadOnce = false;
TB.render('component_6', function(data) {
    if (!loadOnce) {
        var queryString = window.location.search;
        var urlParams = new URLSearchParams(queryString);
        var filter = urlParams.get('filter')
        
        var tabs = ['contact', 'lead', 'won'];
        jQuery( ".filter-tabs li:eq("+tabs.indexOf(filter.toString().toLowerCase())+") a").click();   
        loadOnce = true;
    }
   
});

Thats perfect. Exactly what I needed.
Thank you.

1 Like