I am wanting to change the css in jquery if a certain statement returns true. I have just been playing around without the statement but it doesn't seem to work. This is my js file:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
window.SFW = window.SFW || {};
window.SFW.urgentAlertsItem = {
customItemHtml: function (ctx) {
var urgentAlertsItemHtml = "<div class='urgent'><h2 class='name'>" + ctx.CurrentItem.Title + "</h2>";
urgentAlertsItemHtml += "<div class='note'>" + ctx.CurrentItem.Note+ "</div>";
urgentAlertsItemHtml += "<div class='severity'>" + ctx.CurrentItem.Severity+ "</div>";
urgentAlertsItemHtml += "<div class='profile'> <img src='" + ctx.CurrentItem.Profile+"' /></div>";
urgentAlertsItemHtml += "<button class ='moreDet'>More Detail</button></div>";
return urgentAlertsItemHtml;
}
};
// anonymous self-executing function to setup JSLink templates on page load..
(function () {
var overrideCtx = {};
overrideCtx.Templates = {};
overrideCtx.Templates.Header = "<div id='urg'>";
overrideCtx.Templates.Item = window.SFW.urgentAlertsItem.customItemHtml;
overrideCtx.Templates.Footer = "</div>";
overrideCtx.BaseViewID = 1;
overrideCtx.ListTemplateType = 100;
SPClientTemplates.TemplateManager.RegisterTemplateOverrides(overrideCtx);
})();
// JavaScript source code
$(document).ready(function () {
$(".severity").css("color: blue");
});