Monday 10 June 2013

Color coading to SharePoint List rows conditionally

Reference Url:http://www.sharepointkings.com/2008/12/highlight-sharepoint-list-rows.html

 

Highlight SharePoint List rows conditionally











Hi All,here is some JQuery Stuff that will help you to highlight rows of SharePoint List items based on some condition.

<script type="text/javascript">
if(typeof jQuery=="undefined"){
var jQPath="http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/";
document.write("<script src='",jQPath,"jquery.min.js' type='text/javascript'><\/script>");
}
</script>
<script>
$(document).ready(function(){
$Text = $("td .ms-vb2:contains('Sales')");
$Text.parent().css("background-color", "green");
$Text =$("td .ms-vb2:contains('Account')");
$Text.parent().css("background-color", "orange");
});
</script>

above JQuery code will highlight if Column has 'Sales' then row will highlight with color green.if column has value Account then it will highlight with orange color.

Look at second Post http://www.sharepointkings.com/2009/04/sharepoint-calculated-column-and-jquery.html

No comments:

Post a Comment