{"id":86,"date":"2009-11-03T12:14:02","date_gmt":"2009-11-03T19:14:02","guid":{"rendered":"http:\/\/singchan.com\/?p=86"},"modified":"2009-11-03T12:27:47","modified_gmt":"2009-11-03T19:27:47","slug":"spc09-status-bar-and-notification-apis","status":"publish","type":"post","link":"https:\/\/singchan.com\/wordpress\/2009\/11\/03\/spc09-status-bar-and-notification-apis\/","title":{"rendered":"SPC09: Status Bar and Notification APIs"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignright size-full wp-image-88\" title=\"SharePoint 2010 Status Bar and Notification elements\" src=\"https:\/\/singchan.com\/wordpress\/wp-content\/uploads\/2009\/11\/statusbar_notification.jpg\" alt=\"SharePoint 2010 Status Bar and Notification elements\" width=\"337\" height=\"113\" srcset=\"https:\/\/singchan.com\/wordpress\/wp-content\/uploads\/2009\/11\/statusbar_notification.jpg 337w, https:\/\/singchan.com\/wordpress\/wp-content\/uploads\/2009\/11\/statusbar_notification-300x100.jpg 300w\" sizes=\"auto, (max-width: 337px) 100vw, 337px\" \/>Excuse the really bad screen cap to the right&#8230; the Status Bar and Notifications are two UI elements in SharePoint 2010 which allow us to give the user information in context without distracting them. The Status Bar and Notifications are both exposed as client-side JavaScript APIs.<\/p>\n<h3>Status Bar<\/h3>\n<p>The Status Bar lives below the Ribbon and displays persistent information such as page status or web site alerts. It already existed in SharePoint 2007 as an UI element but it&#8217;s functionality was not exposed as an API. It will display an HTML message, which can include links and\/or images, on 1 of 4 pre-set background colours depending on the importance of the status defined.<\/p>\n<p>There is a Server API to set statuses at page render time as well as a JavaScript API to dynamically add\/remove messages.<\/p>\n<p>The JavaScript API is in the SP.UI.Status namespace and is as follows:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">SP.UI.Status.addStatus(strTitle, strHtml, atBeginning)\r\nSP.UI.Status.updateStatus(sid, strHtml)\r\nSP.UI.Status.removeStatus(sid)\r\nSP.UI.Status.removeAllStatus(hide)\r\nSP.UI.Status.setStatusPriColor(sid, strColor)\r\n<\/pre>\n<h3>Notifications<\/h3>\n<p>Notifications are brand new to SharePoint 2010 and they are used for transient or semi-transient messages such as action confirmations. Notifications appear on the right side of the page below the ribbon and default to a 5 second display period. Like the Status Bar, the message format is HTML with the ability of including links and\/or images.<\/p>\n<p>There is a JavaScript API to add\/remove messages. You also have the option to make a Notification &#8220;sticky&#8221; which means it will continue to display until you manually remove it through the API.<\/p>\n<p>Notifications are in the SP.UI.Notify namespace:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">SP.UI.Notify.addNotification(strTitle, bSticky, tooltip, onclickHandler)\r\nSP.UI.Notify.removeNotification(id)<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Excuse the really bad screen cap to the right&#8230; the Status Bar and Notifications are two UI elements in SharePoint 2010 which allow us to give the user information in context without distracting them. The Status Bar and Notifications are both exposed as client-side JavaScript APIs. Status Bar The Status Bar lives below the Ribbon [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,24,43],"tags":[44,79,164,59,81,42,45,80,47,46,48],"class_list":["post-86","post","type-post","status-publish","format-standard","hentry","category-development","category-javascript","category-sharepoint-development","tag-44","tag-api","tag-javascript","tag-las-vegas","tag-notification","tag-sharepoint","tag-spc09","tag-status-bar","tag-ue","tag-user-experience","tag-ux"],"_links":{"self":[{"href":"https:\/\/singchan.com\/wordpress\/wp-json\/wp\/v2\/posts\/86","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/singchan.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/singchan.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/singchan.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/singchan.com\/wordpress\/wp-json\/wp\/v2\/comments?post=86"}],"version-history":[{"count":5,"href":"https:\/\/singchan.com\/wordpress\/wp-json\/wp\/v2\/posts\/86\/revisions"}],"predecessor-version":[{"id":96,"href":"https:\/\/singchan.com\/wordpress\/wp-json\/wp\/v2\/posts\/86\/revisions\/96"}],"wp:attachment":[{"href":"https:\/\/singchan.com\/wordpress\/wp-json\/wp\/v2\/media?parent=86"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/singchan.com\/wordpress\/wp-json\/wp\/v2\/categories?post=86"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/singchan.com\/wordpress\/wp-json\/wp\/v2\/tags?post=86"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}<!-- WP Super Cache is installed but broken. The constant WPCACHEHOME must be set in the file wp-config.php and point at the WP Super Cache plugin directory. -->