top of page

Adding a Search Feature for Filters

Updated: Dec 13, 2024

Finding the right filter in a dashboard with many options can be frustrating. Instead of scrolling endlessly, you can add a search box to make it easier to find the filter you need. This guide will show you how to quickly set up a search feature for your Sisense dashboard filters.



Steps:

  1. Open Your Dashboard

  2. Insert below dashboard Script

  3. Save and Refresh the Dashboard


dashboard.on('initialized', function (se, ev) {
	$('.filters-headline').css({'height':'50%', });
	$('.filters-global-header').css('height', '65px');

	let searchBox = $('#custom-filter-search');

	if(searchBox) {
		searchBox.remove()
	}

	let $input = $('<input type="text" placeholder="Search..." id="custom-filter-search">');
	$input.css({
		'width': '95%',
		'margin-left': '5px',
		'border-radius': '3px',
		'border': '1.5px solid #bfbfbf',
		'background-color': '#ffffff',
		'font-size': '13px',
		'color': '#757575'
	})
	$('.filters-global-header').append($input);
	$input.on('input', function(){
		const inputValue = $(this).val().toUpperCase();

		$('.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().includes(inputValue)) {
				$(this).css('display', 'block')
			} else {
				 $(this).css('display', 'none')
			}
		})
	})
})



Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating
BI Next Level white logo

BI Next Level is your trusted resource for BI customization, data solutions, and expert insights. Explore practical tips, scripts, and tutorials for tools like Sisense, Python, and SQL. Let’s transform your data into impactful insights together.

Quick Links
Connect with us
Copyright © 2024. All Rights Reserved. Designed, Developed & Maintained  by Intertoons
bottom of page