top of page

Hide dashboard filters

Sometimes, you may need to apply a filter to your dashboard without making it visible. Below is a script that allows you to hide one or more dashboard filters.




Steps:

  1. Open the dashboard where you want to hide the filter.

  2. Add the script below, ensuring you update the 'filterTitles' variable with the list of filters you wish to hide.

  3. Save the script and refresh the dashboard.


const filterTitles = ['Category', 'Condition'];
dashboard.on('initialized', (dash, args) => {

	dash.filters.$$items.forEach((item, index) => {

		if (filterTitles.includes(item.jaql.title)) {

			var styles = `

					.global-filters .ew-content-host .ew-panel .ew-item-wrapper:nth-child(${index+2}) { 

						display: none;

					}`

			var styleSheet = document.createElement("style")

			styleSheet.innerText = styles

			document.head.appendChild(styleSheet)

		}

	})

})

32 views0 comments

Comentarios

Obtuvo 0 de 5 estrellas.
Aún no hay calificaciones

Agrega una calificación
bottom of page