Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 25064

SP.UI.Notify.addNotification not showing immediately

$
0
0

Hi,

I have a FlyoutButton with dynamic menu items that are loaded from web service like this:

onQueryMenu: function (commandId, properties, sequence)
{
	var notificationId = SP.UI.Notify.addNotification("<img src='/_layouts/15/images/loadingcirclests16.gif' style='vertical-align: top;'/>&nbsp;Please wait...", true);
	var sb = new Sys.StringBuilder();

	jQuery.ajax(
		{
			...
			async: false
		})
		...
		}).always(function ()
		{
			SP.UI.Notify.removeNotification(notificationId);
		});

	properties.PopulationXML = sb.toString();
}
The menu itself works fine but I'm having an issue with displaying notification. It does not appear. If I remove "always" part from ajax call I can see the notification but only after call to service is completed and menu items displayed. I have tried using jQuery.noConflict in case there is some conflicts. Still no luck. My guess that some part of addNotification is done in async and not being able to execute callback due to ajax call waiting for response but that's only my guess. Any ideas how to resolve this issue?


Viewing all articles
Browse latest Browse all 25064

Trending Articles