0

I just started learning Sharepoint. I have a problem that I can’t solve. There is a list. It is necessary that for a certain value in a particular column the display of a particular row changes - the background color.

How to hook a label to check a specific column and after it repaints the row?

I found the code. I don’t understand how to adapt it to my needs:

<script type="text/javascript" src="//mysite/SiteAssets/jquery-1.11.0.min.js"></script>
<script type="text/javascript">
    $(document).ready(function () {
        $Text = $("td.ms-cellstyle.ms-vb2:contains('Завершена')"); 
        $Text.parent().css("background-color", "#acf0bd");
        $Text = $("td.ms-cellstyle.ms-vb2:contains('В процессе выполнения')");
        $Text.parent().css("background-color", "#eac117");
        $Text = $("td.ms-cellstyle.ms-vb2:contains('Не начата')");
        $Text.parent().css("background-color", "#c7c5bc");
        $Text = $("td.ms-cellstyle.ms-vb2:contains('Просрочена')");
        $Text.parent().css("background-color", "#c1374f");
    });
</script>

I almost forgot. I use the utility to insert the code CISAR. Maybe I am not adding it there.

  • It can be done easily using Client Side Rendering (CSR). Refer this link; this will help you - codeproject.com/Articles/620110/… – Rohit Waghela Oct 1 at 7:15
  • Check my answer given here, maybe that will help you. – Ganesh Sanap Oct 1 at 7:23
  • 1
    Which version of SharePoint are you using? – harshal gite Oct 1 at 7:24
  • Thanks to everyone for responding. Your answers helped me in solving problems. – AlexGR Oct 2 at 8:59
0

For such scenario's you can use Client Side Rendering in SharePoint.

https://www.codeproject.com/Articles/620110/SharePoint-Client-Side-Rendering-List-Views

  • Do I understand correctly that this method works with a column of type "Resultant Choice" ?? because I tried with the type "Resulting selection" and "The choice" (the choice from the proposed). Or is it somehow tuned? – AlexGR Oct 3 at 7:48

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