0
我對SharePoint自定義場景相當陌生,但已經選擇了一些JavaScript,它將根據單元格的值更改SP列表中單元格的背景顏色。如何將Javascript應用於分組的SharePoint列表?
這工作正常的意見,但任何分組不起作用,我相信是與頁面加載的順序。有沒有辦法將javascript應用到分組並設置爲默認摺疊的視圖?
我看過去年的另一個類似查詢的線程,但似乎沒有解決它的問題。
很多感謝提前!
丹
這是即時通訊使用的單元格顏色變化代碼:
<script type="text/javascript" language="javascript">
var x = document.getElementsByTagName("TD") // find all of the TDs
var i=0;
for (i=0;i<x.length;i++)
{
if (x[i].className=="ms-vb2") //find the TDs styled for lists
{
if (x[i].innerHTML=="Green" && x[i].cellIndex==10)
{
x[i].style.backgroundColor='forestgreen'; // set the background color
x[i].style.color='Black'; //set the font color
}
if (x[i].innerHTML=="Amber" && x[i].cellIndex==10)
{
x[i].style.backgroundColor='Goldenrod'; // set the background color
x[i].style.color='Black'; //set the font color
}
if (x[i].innerHTML=="Red" && x[i].cellIndex==10)
{
x[i].style.backgroundColor='Firebrick'; // set the background color
x[i].style.color='black'; //set the font color
}
}
}
</script>
嗨,正如我上面提到的,我對此很新,目前只是使用在線發現的例子 - 你能告訴我你的建議如何適合上述代碼嗎? 很多謝謝 – user1590527 2012-08-13 07:42:15