Forum Discussion

ascott011's avatar
ascott011
Cloud Apps
01-10-2024
Solved

Tabber Automatic Switching

Hello All, I am creating a dashboard that is displayed on a TV monitor and someone will not be able to manually click between the tabs. Has anyone had success creating a script that would switch be...
  • rapidbisupport's avatar
    01-11-2024

    Hi ascott011 ,

    If you don't actually need the tabber widget taking up space on your dashboard, you can show and hide widgets directly in the dashboard script using the following:

    const time = 2000
    const tabber = {
    	tabs: [
    		{
    			displayWidgetIds: ['659f84e5800ddf004150f248'],
    			hideWidgetIds: ['659f84e9800ddf004150f24a']
    		},
    		{
    			displayWidgetIds: ['659f84e9800ddf004150f24a'],
    			hideWidgetIds: ['659f84e5800ddf004150f248']
    		}
    	]
    }
    
    dashboard.on('domready', () => {
    	const numberOfTabs = tabber.tabs.length
    	let i = 0
    	setInterval(() => {
    		prism.$ngscope.$broadcast('tab-change', {
    			show: tabber.tabs[i].displayWidgetIds || [],
    			hide: tabber.tabs[i].hideWidgetIds || [],
    			tabsConfig: tabber.tabsConfig || 'multiply',
    			renderWidgets: false
    		})
    		i = (i === numberOfTabs - 1) ? 0 : i + 1
    	}, time)
    })
    

    This would have the benefit of saving some space on the TV for more valuable information.

    Let me know how you go with this one?

    Thanks,

    Daniel

    RAPID BI

    [email protected]

    RAPID BI - Sisense Professional Services | Implementations | Custom Add-ons