Showing posts with label Color Gantt chart. Show all posts
Showing posts with label Color Gantt chart. Show all posts

Wednesday, August 22, 2012

Show hide

<script type="text/javascript"> 

// Text to HTML 
// Feedback and questions: Christophe@PathToSharePoint.com 
// 
var theTDs = document.getElementsByTagName("TD"); 
var i=0; 
var TDContent = " "; 
while (i < theTDs.length) { 
try { 
TDContent = theTDs[i].innerText || theTDs[i].textContent; 
if ((TDContent.indexOf("<DIV") == 0) && (TDContent.indexOf("</DIV>") >= 0)) { 
theTDs[i].innerHTML = TDContent; 


catch(err){} 
i=i+1; 

 
// ExpGroupRenderData overwrites the default SharePoint function 
// This part is needed for collapsed groupings 
 
function ExpGroupRenderData(htmlToRender, groupName, isLoaded) { 
var tbody=document.getElementById("tbod"+groupName+"_"); 
var wrapDiv=document.createElement("div"); 
wrapDiv.innerHTML="<TABLE><TBODY id=\"tbod"+ groupName+"_\" isLoaded=\""+isLoaded+ "\">"+htmlToRender+"</TBODY></TABLE>"; 
var theTBODYTDs = wrapDiv.getElementsByTagName("TD"); var j=0; var TDContent = " "; 
while (j < theTBODYTDs.length) { 
try { 
TDContent = theTBODYTDs[j].innerText || theTBODYTDs[j].textContent; 
if ((TDContent.indexOf("<div") == 0) && (TDContent.indexOf("</div>") >= 0)) { 
theTBODYTDs[j].innerHTML = TDContent; 


catch(err){} 
j=j+1; 

tbody.parentNode.replaceChild(wrapDiv.firstChild.firstChild,tbody); 

</script>

Tuesday, July 24, 2012

Color Gantt Chart

<script type="text/javascript" src="/teams/IOBE/Canttouch%20this/jquery-1.3.2.min.js"></script>
<script type="text/javascript">
// Set PicturesPath to the URL of the library that hosts the bar images:
var PicturesPath = "/teams/IOBE/Canttouch%20this/Images";

// Collect the priority level for each task
var barColours = new Array();
var regex = /\(\d\)\s(Amar\sNaidu|Baz\sSelwyn|Carol\sFrancis|Renjiv\sRaman|Ayesha\sSultana)/;
// Find the tasks summary list
var TasksList = $(".ms-ganttOuterTable").siblings("table").find(".ms-summarystandardbody>tbody>tr:not(.ms-viewheadertr)");
if (TasksList.length == 0) TasksList = $(".ms-ganttOuterTable").siblings("table").find(".ms-listviewtable>tbody>tr:not(.ms-viewheadertr)");

TasksList.each(function(i){
try {
barColours[i] = regex.exec($(this).text())[0].substr(1,1);
}
catch(err) {barColours[i] ="";}
});
// Modify the bar color according to priority
$(".ms-ganttTaskRow").each(function(i){
$(this).find("img").each(function(){
       var source=this.src;
       source = source.replace(/.gif/, barColours[i]+".gif");
       source = source.replace(/\/_layouts\/images/,PicturesPath);
       this.src=source;
});
});
//Optional: hide the list under the Gantt view
$(".ms-summarystandardbody").hide();
$(".ms-listviewtable").hide();
</script>

Followers

No Locks without Key

🌿 Bible Verse 1 Corinthians 10:13 "No temptation has overtaken you except what is common to mankind. And God is faithful; ...

Who Am I?

My photo
What is mankind that you are mindful of them, human beings that you care for them? Psalms 8:4 But he made us a little lower than Angels and Crowned with Glory and Honor. How majestic is your name in all the Earth Oh Lord our God!