Advertisement
Guest User

Untitled

a guest
Jul 28th, 2015
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. <ViewData>
  2. <FieldRef Name="MatterRagStatus" />
  3. </ViewData>
  4.  
  5. <ViewFields>
  6. <FieldRef Name="MatterIndicator" />
  7. </ViewFields>
  8.  
  9. <Field ID="{A5AE3A8A-E42A-4A87-9D7F-09E104FED180}"
  10. Name="MatterIndicator"
  11. StaticName="MatterIndicator"
  12. DisplayName="Indicator"
  13. Description="The column calculate matter status"
  14. Type="Text"
  15. ShowInEditForm="FALSE"
  16. ShowInNewForm="FALSE"
  17. ShowInListSettings="FALSE"
  18. Overwrite="TRUE"
  19. JSLink="~site/Scripts/MatterIndicator.js"
  20. Group="Evershed Site Columns">
  21. <Default>•</Default>
  22.  
  23. (function () {
  24. var hiddenFiledContext = {};
  25. hiddenFiledContext.Templates = {};
  26. hiddenFiledContext.Templates.Fields = {
  27. "MatterIndicator": {
  28. "View": IndicatorOverrideFun,
  29. "DisplayForm": IndicatorOverrideFun,
  30. "EditForm": IndicatorOverrideFun,
  31. "NewForm": IndicatorOverrideFun
  32. },
  33. };
  34. SPClientTemplates.TemplateManager.RegisterTemplateOverrides(hiddenFiledContext);})();
  35. function IndicatorOverrideFun(ctx) {
  36. try {
  37. if (ctx.CurrentItem.MatterRagStatus == "1-Red")
  38. return "<span style='font-size: 300%; line-height: 10%;color: #FF0000;'>•</span>";
  39. else if (ctx.CurrentItem.MatterRagStatus == "2-Amber")
  40. return "<span style='font-size: 300%; line-height: 10%;color: #FFBF00;'>•</span>";
  41. else
  42. return "<span style='font-size: 300%; line-height: 10%;color: #00FF00;'>•</span>";
  43. } catch (e) {
  44. console.log(e);
  45. return "";
  46. }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement