cancel
Showing results for 
Search instead for 
Did you mean: 

Tabber selected filters

Priyanka
7 - Data Storage
7 - Data Storage

Hi,

I have two tabbers for two different teams for eg: Sales and Marketing to view their respective metrics on their respective tabbers. I also have a filter name called 'Manager' to filter those who head each of these team. I want to default one manager (ex: Jack) to Sales tabber and another manager (ex: Jill) to Marketing tabber. 


Also, how can I default various filters on these tabs?

2 REPLIES 2

Priyanka
7 - Data Storage
7 - Data Storage

@harikm007 please suggest. 

harikm007
13 - Data Warehouse
13 - Data Warehouse

Hi @Priyanka , 

If you are using WidgetsTabber plugin, try this script (add this script to tabber widget and replace text as per the comment in script):

 


widget.on('ready',function(w, e) { 	
	
	$('.listDefaultCSS .listItemDefaultCSS', element).on('click', function(s){ 
		
		filter = prism.activeDashboard.filters.$$items.find(el=>el.jaql.title == 'Region') //Replace 'Region' with title of filter
	
		//mapping of Tab name and filter item. Here when Tab1 is selected, 'South' will get selected in Region filter
		var tabFilterMapping = {
			'Tab1':"South",
			'Tab2':"Northeast"
		}
		
		var filterValue = tabFilterMapping[$(s)[0].currentTarget.innerHTML]

		filter.jaql.filter = {
			"explicit": true,
			"multiSelection": false,
			"members": [
			filterValue
			]
		}

		var filterOptions = {
								save: true,
								refresh: true,
							}

		
		prism.activeDashboard.filters.update(filter, filterOptions)
	}) 
})

 

 -Hari