Wednesday, May 25, 2016

How to change color row to change text color in a custom list



 You have to add a script in Edit Page\Edit Webpart> content and add the script in the JS portion(see the above link to find the exact location and then use the following script)
Aprroved= Red
Pending= Silver
Completed= Gold

<script type="text/javascript"src="//ajax.googleapis.com/ajax/libs/jquery/1.10.0/jquery.min.js"></script>
    <script type="text/javascript">
    $(document).ready(function () {
    $Text = $("td.ms-cellstyle.ms-vb2:contains('Aprroved')");
    $Text.parent().css("background-color","#01DF3A");
    $Text = $("td.ms-cellstyle.ms-vb2:contains('Pending')");
    $Text.parent().css("background-color", "#EAC117");
    $Text = $("td.ms-cellstyle.ms-vb2:contains('Completed')");
    $Text.parent().css("background-color", "#E9967A");
        });
    </script>

No comments:

Post a Comment