2010-05-25 33 views

回答

0

虽然这是一个迟到的答案,但这个问题仍然被问到很多。

我已经把这样的可能方法的总结,与链接到有更详细的演练(包括@Muhimbi提到克里斯托夫的解决方案)网页:

How to do list highlighting in SharePoint

这是我公司的博客[对不起],并通过创建一个具有此功能[对不起]商业产品的启发,我不可避免地提及该产品在博客[ 现在购买 对不起]

0

下面的代码高亮显示并添加样式母公司基于一些表格单元格的数值(接近)表行

在SharePoint Designer条件格式是不工作的权利,我所期望的方式使用该jQuery代码好得多

<script src="https://portal/SiteAssets/jsLibrary/jquery.1.9.1.min.js" type="text/javascript"></script> 

<script type="text/javascript"> 
jQuery.noConflict(); 

jQuery(document).ready(function() { 
// Wait until SP.JS has loaded before calling ConditionalFormatting 
    ExecuteOrDelayUntilScriptLoaded(ConditionalFormatting, "sp.js"); 
}); 

    function ConditionalFormatting(){ 
     jQuery('table[id*="7011A98DAFA5"] tbody td').each(function(){ 
      var valD=parseFloat(jQuery(this).text()); 
      if (valD== 0.16){ 
       jQuery(this).closest('tr').css('background-color','yellow') 
      } 
      else if (valD > 0.16){ 
       jQuery(this).closest('tr').css({'background-color':'red'}) 
      } 
      else if (valD< 0.16){ 
       jQuery(this).closest('tr').css('background-color','green') 
      } 
     }); 
    } 


</script> 
相关问题