top of page

Custom No Result message

Below script will allow you to change default 'No Result' message to any message you want. It is possible to apply different messages to each widget.


Steps:

  1. Create a widget

  2. Add below script. Update the variable 'no_result_message' and 'no_result_url' with your new message and image url respectively.

  3. Save the script and refresh widget


widget.on('domready', function(se){
	
	no_result_message = 'No sales data available'
	no_result_url = 'https://thumbs.dreamstime.com/z/no-found-symbol-unsuccessful-search-vecotr-upset-magnifying-glass-cute-not-zoom-icon-suitable-results-oops-page-failure-122786031.jpg'
	
	if(se.$noResults)
	{		
		if (prism.activeWidget == null)
			no_result_container = $(`widget[widgetid="${se.oid}"]`)
		else
			no_result_container = $('.prism-widget-preview')
		
		if(no_result_message.length > 0)
		{
			$(no_result_container).find('.widget-no-result-overlay .widget-no-result-notify-holder .no-result-title').text(no_result_message)
		}
			
		if(no_result_url.length > 0)
		{
			$(no_result_container).find('.widget-no-result-overlay .widget-no-result-notify-holder .image').attr('src', no_result_url)
			$(no_result_container).find('.widget-no-result-overlay .widget-no-result-notify-holder .image').css('width', 'auto')
		}
	}
})

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