0

Example of Table columns to colour code

I have a table where by I want to colour code column names "WIS Completed" depending on whether status of facilities (Data Modelling, Data Logistics, RPT, NC, Paint, Trim, Composites and Model Shop( is "Pending" "Problem" "WIP" "Accepted" "Completed" etc.

Ultimately If 1 status is “Stopped”, “Problem” or “Rejected” Cell “WIS Completed” is to be RED

If no status' are “Stopped”, “Problem” or “Rejected” but 1 status is “Accepted”, “Pending” or “WIP” Cell “WIS Completed” is to be YELLOW

If no status “Stopped”, “Problem”, “Rejected”, Accepted”, “Pending” or “WIP” and 1 status is “Completed” Cell “WIS Completed” to be GREEN

1

Use a Calculated Column StatusColor to built your logic and determine a Color

Then either

  • use some 25 lines of SP2013 Client Side Rendering JavaScript code
    to color the rows based on the calculation

    Examples: https://code.msdn.microsoft.com/office/Client-side-rendering-JS-2ed3538a

    You can determine the color within the script file; but that requires (more) editting for any future changes.

  • or stuff the HTML/JavaScript in a second Calculated column (set to datatype=Number)
    to Color the row with 2 lines of JavaScript

    ="<img src=""/_layouts/images/blank.gif"" onload=""{"
        &"var TR=this;while(TR.tagName!='TR'){TR=TR.parentNode}"                
        &"TR.style.backgroundColor='" 
     &[StatusColor]
        &"';"
     &"}"">"
    

More Pros & Cons of this at: http://www.viewmaster365.com/#/How

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.