cancel
Showing results for 
Search instead for 
Did you mean: 

Hide Widget

gwolfe
9 - Travel Pro
9 - Travel Pro

Hi, I referenced this post to arrange widgets https://community.sisense.com/t5/build-analytics/arranging-widgets-in-a-dashboard/m-p/2827

I want the widgets I am referencing to remain on the same dashboard, but I want to hide them so that they are only displayed in the blox widget. 

Is there a script to hide widgets based on their ID?

 

 

 

 

1 ACCEPTED SOLUTION

harikm007
13 - Data Warehouse
13 - Data Warehouse

Hi @gwolfe ,

Here is a post on how to hide widget from dashboard

https://www.binextlevel.com/post/hide-widgets-from-a-dashboard

Script:

dashboard.on('widgetrefreshed', function (se, ev) {

	widgetList = ['625e34a5aer456002ea7b64d', '6789cdc6fa34563002er56456']
	
	if(widgetList.includes(ev.widget.oid))
	{
		$(`widget[widgetid="${ev.widget.oid}"]`).closest('.dashboard-layout-subcell-host').addClass('dontshowme-parent')
	}
});

-Hari

View solution in original post

3 REPLIES 3

harikm007
13 - Data Warehouse
13 - Data Warehouse

Hi @gwolfe ,

Here is a post on how to hide widget from dashboard

https://www.binextlevel.com/post/hide-widgets-from-a-dashboard

Script:

dashboard.on('widgetrefreshed', function (se, ev) {

	widgetList = ['625e34a5aer456002ea7b64d', '6789cdc6fa34563002er56456']
	
	if(widgetList.includes(ev.widget.oid))
	{
		$(`widget[widgetid="${ev.widget.oid}"]`).closest('.dashboard-layout-subcell-host').addClass('dontshowme-parent')
	}
});

-Hari

This script works like a charm, but is it possible to edit this script so you can use a button to hide/unhide a widget. This script works, but it only makes a widget invisible

Gr. Sandeep

gwolfe
9 - Travel Pro
9 - Travel Pro

Perfect, thank you