SP.UI.Status
SP.UI.Notify
Sharepoint 2010 have many new UI enhancements. Two enhancements are Status Bar and Notification Area. Both of these can be used to provide useful information to the users. Both of these appears under Ribbon Tab. Status Bar is mostly for something like permanent information. Notifications appears for certain period of time then disappears with some transition effects. Working with Status Bar We can provide HTML content to the message. We can add images and styles. The status bar can have one of the pre defined colors(red, green, blue, yellow) depending on priority of the immage. For example if message is very important we can show it in red. Status bar is exposed SharePoint JavaScript API defined inside sharepointroot\templates\layouts\SP.js Methods exposed by SP.UI.Status
We can show status bar in different colors depending on importance of message. If very important then use red, if warning message in then use yellow color.
Working with Notifications
Notification Area usually appears right corner below the ribbon. this is used when the users needs to to updated for the processes being performed. Like saving content, saved content.
Methods exposed by SP.UI.Notify
SP.UI.Notify
Sharepoint 2010 have many new UI enhancements. Two enhancements are Status Bar and Notification Area. Both of these can be used to provide useful information to the users. Both of these appears under Ribbon Tab. Status Bar is mostly for something like permanent information. Notifications appears for certain period of time then disappears with some transition effects. Working with Status Bar We can provide HTML content to the message. We can add images and styles. The status bar can have one of the pre defined colors(red, green, blue, yellow) depending on priority of the immage. For example if message is very important we can show it in red. Status bar is exposed SharePoint JavaScript API defined inside sharepointroot\templates\layouts\SP.js Methods exposed by SP.UI.Status
- addStatus: Accepts three parameters Title, Message as HTML , show at begining as boolean. Returns status ID sid = SP.UI.Status.addStatus(strTitle, htmlMessage, boolatBegning)
- removeStatus: removes status specified by status id. SP.UI.Status.removeStatus(sid)
- removeAllStatus: Removes all Status bar messages. Pass true if you want to hide bar. removeAllStatus(true)
- setStatusPriColor: Takes two parameter status id and colorsetStatusPriColor(sid,"red")
SharePoint 2010 Status Bar |
- addNotification: Accepts two parameters Message as html and a Boolean value indicating sticky or not. If second parameter is passed as false then notification disappears after 5 seconds. This method returns notification id.
- removeNotification: Removes notification specified by notification id.
notificationID = SP.UI.Notify.addNotification(
}
var notificationID;function ShowNotification() {"This is my first notification", true, " Tooltip", "Helloworld"); </script>
The above script will show sticky Notification. Pass second parameter as false in above script to hide Notification after 5 seconds.
SharePoint 2010 Notification |