Status Bar in SharePoint 2010 - Tutorial
Status bar is exposed SharePoint JavaScript API defined inside sharepointroottemplateslayoutsSP.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”)
<script langauage=”javascript”>
var statusID;
function ShowStatus()
{
statusID = SP.UI.Status.addStatus(“Information”,”This is my first status bar”,true);
}
</script>
The above script will show status bar in red.
We can show status bar in diffrent colors depending on importance of message. If very important then use red, if warning message in then use yellow color.
0 comments:
Post a Comment