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:
Create a widget
Add below script. Update the variable 'no_result_message' and 'no_result_url' with your new message and image url respectively.
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