Stump the Panel Topic: Customize a list view with colors http://www.endusersharepoint.com/STP/ SharePoint QA en Mon, 03 Aug 2009 18:25:29 +0000 DS1 on "Customize a list view with colors" http://www.endusersharepoint.com/STP/topic/customize-a-list-view-with-colors#post-8865 Mon, 03 Aug 2009 08:58:21 +0000 DS1 8865@http://www.endusersharepoint.com/STP/ <p>There are not calculated fields. Just a choice column which indicates Green/Red/Yellow. Based on the choice, the above code colors the field appropriately. </p> Nelson on "Customize a list view with colors" http://www.endusersharepoint.com/STP/topic/customize-a-list-view-with-colors#post-8828 Thu, 30 Jul 2009 15:00:44 +0000 Nelson 8828@http://www.endusersharepoint.com/STP/ <p>Hello DS1,</p> <p>I'm interested in your project -- I've got something coming up that may have similar status ranges. Can you please tell me what calculated fields you have in addition to the above script.</p> <p>Thank You </p> eric on "Customize a list view with colors" http://www.endusersharepoint.com/STP/topic/customize-a-list-view-with-colors#post-8825 Thu, 30 Jul 2009 13:41:26 +0000 eric 8825@http://www.endusersharepoint.com/STP/ <p>It probably has different syntax and markup in datasheet view. Use IE Developer Toolbar to see if you can find the syntax it needs. </p> DS1 on "Customize a list view with colors" http://www.endusersharepoint.com/STP/topic/customize-a-list-view-with-colors#post-8801 Wed, 29 Jul 2009 19:02:47 +0000 DS1 8801@http://www.endusersharepoint.com/STP/ <p>I have a list view which I have been able to add colors to indicate progress in a status colum - Green (On Time) Yellow (Danger)and Red (Miss). I've been able to accomplish this for the standard view by using a Content Editor web part and using the following code:</p> <p>&lt;script type="text/javascript" language="javascript"&gt;<br /> var x = document.getElementsByTagName("TD") // find all of the TDs<br /> var i=0;<br /> for (i=0;i&lt;x.length;i++)<br /> if (x[i].className=="ms-vb2") //find the TDs styled for lists<br /> {<br /> if (x[i].innerHTML=="Green-OnTime") //find the data to use to determine the color<br /> {<br /> x[i].style.backgroundColor='green'; // set the background color<br /> x[i].style.color='white'; //set the font color<br /> } </p> <p> if (x[i].innerHTML=="Yellow-Danger") //find the data to use to determine the color<br /> {<br /> x[i].style.backgroundColor='Gold'; // set the background color<br /> x[i].style.color='black'; //set the font color<br /> } </p> <p> if (x[i].innerHTML=="Red-Miss") //find the data to use to determine the color<br /> {<br /> x[i].style.backgroundColor='red'; // set the background color<br /> x[i].style.color='white'; //set the font color<br /> }<br /> } </p> <p>&lt;/script&gt; </p> <p>The problem is I cannot get this to work if the view is a Data Sheet View in the same list. Any suggestions for getting this to work in a data sheet view? </p>