Marty
July 12, 2022, 4:39pm
1
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.
moe
July 13, 2022, 5:15am
2
@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;
}
});
Marty
July 13, 2022, 1:57pm
3
Thats perfect. Exactly what I needed.
Thank you.
1 Like