13 Sep 2011

Status Bar and Notification Area - SharePoint2010

The Status Bar and the Notification Area are two new features introduced in SharePoint 2010. Both are based on ECMAScript code



SP.UI.Notify class for managing the Notification Area   

Example :  JavaScript code

Show Notification

var notifyId = SP.UI.Notify.addNotification("Operation Success! !", true);

To remove the notification:



addNotification  ( Message to show, IsPermanent)

Used to add a notification to the Notification Area. Requires the text of the notification and a Boolean argument to specify if the notification will stay on the page until explicitly removed.
returns NotificationID.

removeNotification ( NotificationID)
Removes a notification from the Notification Area.


Status Bar

SP.UI.Status class for managing the Status Bar


Show a status in red color:

var statusId = SP.UI.Status.addStatus("Critical Status!");
SP.UI.Status.setStatusPriColor(statusId, 'red');

To remove the status message, you use this code:




addStatus  (Message)
Used to add a status to the Status Bar. Returns an ID identifying the status.

appendStatus (StatusID, Message)

Appends text to an existing status message in the Status Bar.

removeAllStatus ()
Removes all the status messages from the Status Bar and hides the Status Bar.

removeStatus (StatusID)
Removes a status message from the Status Bar. Requires the ID of the status message that is being removed.

setStatusPriColor (StatusID, colorCode)
Configures the color of the Status Bar.

updateStatus (StatusID, NewMessage)
Updates a status message. Requires the ID of the status message that is being updated.

No comments:

Post a Comment