Forum Discussion

harikm007's avatar
harikm007
Data Warehouse
09-05-2022

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.

Refer: https://www.binextlevel.com/post/custom-no-result-message

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')
		}
	}
})

-Hari

 

 

1 Reply

Replies have been turned off for this discussion