Forum Discussion

gwolfe's avatar
gwolfe
Data Pipeline
06-15-2022
Solved

Hide Widget

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?

 

 

 

 

  • 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

3 Replies

Replies have been turned off for this discussion
  • harikm007's avatar
    harikm007
    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

    • shahamel's avatar
      shahamel
      Cloud Apps

      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