0

I have a long status list in SharePoint 2019 that has the following CSS for color coding rows:

  1. How do I get this to work on all the multiple pages vs just the first page of the list.
  2. Can the code be modified to work with a grouped view as well?

NOTE: WE CAN'T DO JSON FORMATTING

<script type="text/javascript" src="/sites/aaa/MSLibrary/jquery-1.11.1.min.js"></script> 

 $(document.ready(function(){   
    $Text=$("td.ms-cellstyle.ms-vb2:contains('High')"); 
      $Text.css("background-color", #FFAA99");  
    $Text=$("td.ms-cellstyle.ms-vb2:contains('Medium')"); 
      $Text.css("background-color", #FFFF99");  
    $Text=$("td.ms-cellstyle.ms-vb2:contains('Low')"); 
      $Text.css("background-color", #EEFFE6"); }); 

<script type="text/javascript" src="/sites/aaa/MSLibrary/jquery-1.11.1.min.js"></script>

  $(document.ready(function(){   
      $Text=$("td.ms-cellstyle.ms-vb2:contains('Not Started')"); 
          $Text.css("background-color", #F0F0F0");  
      $Text=$("td.ms-cellstyle.ms-vb2:contains('In Progress')"); 
          $Text.css("background-color", #D9E5F0");  
      $Text=$("td.ms-cellstyle.ms-vb2:contains('Completed')"); 
          $Text.css("background-color", #99CC66"); }); 

<script type="text/javascript" src="/sites/aaa/MSLibrary/jquery-1.10.2.js"></script>  
<script type="text/javascript"> 

(function($){ 
  function doCollapseTaskList(){   
    $(.ms-commentcollapse-iconouter>img">.each(function(){ 
      $(this).click(); 
    }); 
  }

  $(function(){       
    ExecuteOrDelayUntilScriptLoaded(function(){ 
      if(typeofasyncDeltaManager !="undefined")        
        asyncDeltaManager.add_endRequest(doCollapseTaskList); 
      else 
        doCollapseTaskList(); 

  },"init.js"); 
}); 

Thanks for the help in advance!

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.