Forum Discussion

jalam's avatar
jalam
Data Storage
09-18-2024
Solved

Issue: Unable to Hide Main Filter by Title in Sisense Using

I am trying to hide a filter in my Sisense dashboard based on its title using Script, but I am running into issues. The filter in question is named "Username", and I'm attempting to hide it once the dashboard is initialized.
 
 
I tried below community post by changing it to hide main filter but it's not working as I don't have dependent filter in my dashboard. Am I missing something?
 

 

 

5 Replies

  • harikm007's avatar
    harikm007
    Data Warehouse

    Hi jalam ,

    Try below dashboard script to hide a filter by title

    const filterToHide = 'Category'
    
    dashboard.on('widgetready', (d, args) => {
    	$('.global-filters .ew-content-host .ew-panel .ew-item-wrapper').each(function(index, element){
    		if ($(this).find('.f-header-host .ew-i-caption').text().toUpperCase() === (filterToHide.toUpperCase())) {
    			$(this).css('display', 'none')
    		} else {
    			$(this).css('display', 'block')
    		}
    	})
    })

     

    -Hari

    https://www.binextlevel.com/home 

    • jalam's avatar
      jalam
      Data Storage

      Hi Hari,

      Thank you for your response!

      This script flashes filter for a while then hide it. I want it to hide as soon as the dashboard loads. can you help me on this?

      • jalam's avatar
        jalam
        Data Storage

        Also I want to hide multiple filters by title.

    • jalam's avatar
      jalam
      Data Storage

      it works for me. 

      Thanks Hari!