The slider for Gantt views was part of the 7+1 live demos I published last November; moving the handle or directly clicking on the slider allows you to resize the Gantt.
After some additional adjustments, I am ready to release today a sample script.
I did not build the slider. I simply took an existing one offered by the jQuery UI library, and combined it with my technique to scale down the Gantt view.
Here is my sample code:
<!-- Slider for Gantt view -->
<!-- Questions and comments: Christophe@PathToSharePoint.com -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js" type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.5.3/jquery-ui.min.js" type="text/javascript"></script>
<style type="text/css">
#scale {
color: #478AFF;
font-weight:bold;
position: absolute;
left:16px;
top: 12px;
}
#mainslider {
width: 510px;
}
#content-slider {
width: 500px;
height: 8px;
margin: 10px;
background: #BBBBBB;
position: relative;
}
.content-slider-handle {
width: 12px;
height: 20px;
position: absolute;
top: -6px;
background: #478AFF;
border: solid 1px black;
}
</style>
<div id="mainslider">
<div id="content-slider">
<div class="content-slider-handle"><span id="scale">100%</span></div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
$("#content-slider").slider({
animate: true,
handle: ".content-slider-handle",
change: handleSliderChange,
steps: 15,
min: 25,
startValue: 100,
slide: handleSliderSlide
});
});
function handleSliderChange(e, ui)
{
$(".ms-ganttInnerTable IMG").width(16*ui.value/100) ;
}
function handleSliderSlide(e, ui)
{
$("#scale").text(ui.value+"%");
}
$("#mainslider").one("mouseover", function(){
$(".ms-ganttDetailTimeUnitRow *").css("display", "none");
var monthname=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
$(".ms-ganttMajorTimeUnitHeaderCell").each(function(){
var d=$(this).text().split("/",3);
d[2] = d[2].replace("20","'");
$(this).html(monthname[d[0]-1]+"<br />"+d[2]);
});
});
</script>
As usual, use a CEWP to include the code in your page.
The script calls two libraries: jQuery and jQuery UI. In my sample code I pull them from Google APIs, but you can also store them directly on your SharePoint farm. Also, note that you don’t need the full jQuery UI library, you can restrict yourself to the core UI and the slider.
In addition to the jQuery documentation, I found this post very helpful.
Click here to try out the live demo!
Update [Jan 22, 2009] The script is written for a MM/DD/YYYY date format. If for example your date format is DD-MM-YYYY, then use these formulas:
var d=$(this).text().split("-",3);
d[2] = d[2].replace("20","'");
$(this).html(monthname[d[1]-1]+"<br />"+d[2]);


100 comments
Comments feed for this article
January 21, 2009 at 5:55 pm
Anonymous
Is it supposed to get choppy? When I was playing with it, the view was fine until 80%. At 80% and lower, gaps appeared in the bars next to the tasks.
January 21, 2009 at 6:05 pm
Christophe
Was this on my demo? The timescale should resize itself to avoid this behavior. Could you send me more information (and tell me which browser you’re on): Christophe@PathToSharePoint.com.
January 21, 2009 at 6:27 pm
Christophe
I made a slight change, now it should look like the screenshot.
January 22, 2009 at 8:52 am
Adrian
Youre website is amazing, you have great ideas.
I use Internet Explorer in my Office and the Slider Works fine, but the month-view doesn’t work. It shows still the standard dayli view.
Thanks for your help Christophe!
January 22, 2009 at 9:17 am
none
seems the demoscript is different then the script above in this page. The one in the demo works, the other does not. Also I get choppy image chunks after scaling down the size.
January 22, 2009 at 9:29 am
none
I’ve found the reason why the script above does not work. It seems the html code was missing in the “” tags on line 73. This causes the code to go to the next line in the script above but it should not do this. the line should look like this:
$(this).html(monthname[d[0]-1]+”"+d[2]);
January 22, 2009 at 9:48 am
Christophe
Thanks none, there should actually be a line break:
For the fourth time this week I was tricked by my editor, sorry for that…
January 22, 2009 at 1:49 pm
Christophe
Adrian, is your issue related to this post? If not, may I ask you to move it to the appropriate post, and precise your problem?
January 22, 2009 at 2:35 pm
Christophe
I have updated the script to fix the choppy effect and re-insert the missing line break. I have also changed the reference to the latest version of jQuery, 1.3.1, which was released on Jan 21st.
Plus a footnote about date formats.
January 29, 2009 at 1:15 pm
Mark
Looks great unfortunately when I add it to my web page the slider appears but doesn’t change either the chart or the scale number. I’ve tried it with the .js file on my local server as well as from google.
What am I missing!
January 29, 2009 at 1:50 pm
Christophe
Strange… Are you able to move the handle? Did you include both libraries, jQuery and jQuery UI? And which browser are you using?
January 29, 2009 at 2:10 pm
Mark
Not sure what the difference was but used Fiddler to view the script from the demo site and copied over the contents of the web part and now it works!
Brilliant.
February 10, 2009 at 1:27 pm
Christophe
Update (and answer to Mark): the last version of jQuery (1.3.1) is not compatible with the current version of jQuery UI (1.5.3). I have switched back to jQuery 1.2.6 in the script.
March 3, 2009 at 5:49 pm
Erich O'Donnell
Christophe,
Great post. I noticed that in your screenshot above, you have the gantt chart broken down by month. I don’t need the slider functionality, but I do need to break down the gantt chart into a monthly view. Can you help me out?
Thanks in advance,
Erich
March 4, 2009 at 1:25 am
Christophe
Erich, it’s not exactly a monthly view. I have just reformated the week view to hide the days. This is done in the last 10 lines of the script.
March 5, 2009 at 11:56 am
Ian
Hi Christophe
Thanks for all the cool stuff – it has been amazingly useful.
I can’t get the Gantt chart to work at all – all I get is raw code in the CEWP. I tried same before Christmas and got a slider, but reverted to my previous state as it didn’t affect the Gantt – same as Mark above – and I didn’t have time to figure it out.
I notice there is no reference in the script to the two jQuery libraries – I seem to recall there was before and you refer to them in the text.
Thanks in advance for any help you can provide.
Ian
March 5, 2009 at 12:21 pm
Christophe
My blog editor tricked me again, sorry for that!
The script should work now. Note that you need to use compatible versions of jQuery and jQuery UI (that was the issue in Mark’s case).
March 10, 2009 at 4:13 pm
Benny
Hi Christophe! Thanks again for your great work!
But what if I want the title row not to scroll with the tasks?
Thx!
Benny
March 12, 2009 at 1:32 pm
Torsten
Hi Christophe! Thanks for this great work! is it possible to display the week number in addition to the month?
Torsten
March 12, 2009 at 2:56 pm
Benny
got it!!!!
To fix the header row and the left column the style tag has to be replaced by:
#scale {
color: #478AFF;
font-weight:bold;
position: absolute;
left:16px;
top: 12px;
}
#mainslider {
width: 510px;
}
#content-slider {
width: 500px;
height: 8px;
margin: 10px;
background: #BBBBBB;
position: relative;
}
.content-slider-handle {
width: 12px;
height: 20px;
position: absolute;
top: -6px;
background: #478AFF;
border: solid 1px black;
}
.ms-ganttInnerTable{
z-index:10;
}
.ms-ganttOuterTable{
empty-cells: show;
}
.ms-ganttMajorTimeUnitHeaderCell {
writing-mode: tb-rl;
filter: flipv fliph;
vertical-align: top;
top: expression(this.offsetParent.scrollTop);
position: relative;
z-index: 15;
column-span: 1;
background-color: white;
width= 16;
}
.ms-ganttTitleCell{
left: expression(parentNode.parentNode.parentNode.parentNode.scrollLeft);
position: relative;
z-index: 20;
background-color: white;
}
.ms-ganttTitleHeaderCell{
top: expression(this.offsetParent.scrollTop);
left: expression(parentNode.parentNode.parentNode.parentNode.scrollLeft);
position: relative;
background-color: white;
z-index: 30;
}
.ms-ganttDetailTimeUnitRow {
position: relative;
top: expression(this.offsetParent.scrollTop);
background-color: white;
}
May 11, 2009 at 5:16 pm
Michael McKee
Benny, I had a user who ONLY wanted to lock the Title column and Date scale, as in a spreadsheet’s Freeze Panes, and your solution led me to what I needed!
To freeze panes in your SharePoint Gantt Chart view, add a CEWP with the following code:
.ms-ganttInnerTable{
z-index:10;
}
.ms-ganttOuterTable{
empty-cells: show;
}
.ms-ganttMajorTimeUnitHeaderCell {
vertical-align: top;
top: expression(this.offsetParent.scrollTop);
position: relative;
z-index: 15;
column-span: 1;
background-color: white;
width= 16;
}
.ms-ganttTitleCell{
left: expression(parentNode.parentNode.parentNode.parentNode.scrollLeft);
position: relative;
z-index: 20;
background-color: white;
}
.ms-ganttTitleHeaderCell{
top: expression(this.offsetParent.scrollTop);
left: expression(parentNode.parentNode.parentNode.parentNode.scrollLeft);
position: relative;
background-color: white;
z-index: 30;
}
.ms-ganttDetailTimeUnitRow {
position: relative;
top: expression(this.offsetParent.scrollTop);
background-color: white;
}
May 11, 2009 at 5:21 pm
Michael McKee
In Style tags, of course. Opening tag should include [style type="text/css"] in between the “” and close with a regular “”.
May 15, 2009 at 9:03 am
Matt
Michael,
Fantastic!
I’ve implemented your code successfully but would also like to have the Gantt to open at todays date instead of the start date of the first task created. Any ideas?
Many thanks,
Matt
May 16, 2009 at 2:48 am
Christophe
Benny and Michael, thanks for your input!
May 26, 2009 at 2:28 am
Matt
Hi,
I managed to get the autoscroll working, there is a slight lag on page load so if anyone has any suggestions on a better way to do this please let me know.
.ms-ganttOuterTable{
empty-cells: show;
}
.ms-ganttMajorTimeUnitHeaderCell {
vertical-align: top;
top: expression(this.offsetParent.scrollTop);
position: relative;
z-index: 15;
column-span: 1;
background-color: white;
width= 16;
}
.ms-ganttDetailTimeUnitRow {
vertical-align: top;
top: expression(this.offsetParent.scrollTop);
position: relative;
z-index: 15;
column-span: 1;
background-color: white;
width= 16;
}
.ms-ganttTitleCell{
left: expression(parentNode.parentNode.parentNode.parentNode.scrollLeft);
position: relative;
z-index: 20;
background-color: white;
}
.ms-ganttTitleHeaderCell{
top: expression(this.offsetParent.scrollTop);
left: expression(parentNode.parentNode.parentNode.parentNode.scrollLeft);
position: relative;
background-color: white;
z-index: 30;
}
.ms-GT {
background-color: #98FB98;
window.onload = function(){
DoIt();
}
function DoIt() {
var objDIV;
var objTD;
var arrElements;
arrElements = document.getElementsByTagName(“div”);
for (var i = 0; i < arrElements.length; i++) {
if (arrElements(i).className == "ms-ganttDiv") objDIV = arrElements(i);
}
arrElements = objDIV.getElementsByTagName("td");
for (var i = 0; i < arrElements.length; i++) {
if (arrElements(i).className == "ms-GT") objTD = arrElements(i);
}
objDIV.scrollLeft = Math.round(objTD.offsetLeft – objDIV.offsetWidth / 2);
return 1;
};
Thanks,
July 22, 2009 at 5:51 pm
M.
Great solution!
Thanks,
M.
August 7, 2009 at 4:07 pm
Vivian
Hi, the freezing pane code works perfect for IE, but not for other browsers like Firefox, Chrome, etc. Is there any way around? Thanks a lot.
March 12, 2009 at 2:57 pm
Benny
okay there is some useless code, too^^
March 13, 2009 at 10:44 pm
Jimmy
What if your date format is not MM/DD/YYYY or DD-MM-YYYY? DD/MM/YYYY format.
March 15, 2009 at 9:28 pm
Dan
Christophe!
This is yet another OUTSTANDING contribution to the collective utility of SharePoint – you are by far the definitive innovator for the masses on this platform. Keep up the GREAT work!!! -Dan
May 13, 2009 at 5:21 pm
Colleen Parker
Bravo!
March 16, 2009 at 9:23 am
Christophe
Jimmy: use the script for DD-MM-YYYY, and simply replace “-” with “/”…
March 16, 2009 at 9:42 am
Christophe
Thanks for sharing Benny. Note that “expression” is specific to Internet Explorer.
March 17, 2009 at 11:51 am
Ian
Thanks Christophe
March 23, 2009 at 6:26 pm
Jimmy
Duh! Thanks Christophe!
How would you change the script so that at 100%, the header is unchanged. Eg. shows the dates normally rather than “Jan” x 4, “Feb” x3, “Mar” x 5 etc.)
AND show quarters at 25% (e.g. |Q1 ’09 for Jan, Feb, & March)2009)?
April 28, 2009 at 5:16 pm
MSI-Linda
All of my customers LOVE the built-in Gantt view, and so always want it customized. They all seem to have the same requirements for;
1. multiple List Columns on the LEFT rather than just the Title
2. Title Group By
3. Month, Quarter, Year gantt views, never day and week
Is is just not possible at all to create a custom Gantt chart like that through SPD?
I tried the Bamboo Calendar and Task list and neither of those meet all of those requirements above either. And none of the JavaScript examples on any sites seem to accomplish this either.
May 28, 2009 at 9:31 am
Gantt Slider « Mihai Plesa
[...] Check it out here: http://pathtosharepoint.wordpress.com/2009/01/21/a-slider-for-the-gantt-view/. [...]
June 1, 2009 at 10:50 pm
MSI-Linda
I need to change the default slider view from 100% view to default showing it at 25% view. Is there a way for me to do that so they don’t have to slide down to 25% every time?
June 1, 2009 at 11:48 pm
Christophe
Linda, try this:
- change startValue from 100 to 25
- remove lines 68 and 76 (time scale)
June 2, 2009 at 12:00 am
MSI-Linda
If by line 68 you mean $(“#mainslider”).one(“mouseover”, function(){ that does not work, everything is still really at 100% even though the slider shows 25.
June 2, 2009 at 1:04 am
Christophe
Linda: this require more changes than I initially thought. Here is what I came up with. You can check out the live demo here.
June 2, 2009 at 1:09 am
MSI-Linda
Thanks for replying so quickly. Your second solution above worked perfectly. I like it defaulting there because it looks more like a Quarter/Month view like my customer needs.
Thanks again!!
June 18, 2009 at 10:33 pm
Kees
Christophe,
Thanks for this code. Almost perfect.
Could you give me a hint on how to add one extra column on the left?
For example the list already contains extra column called “Domain” but how to get that displayed in the Gantt?
Thanks for your help.
Kees
June 19, 2009 at 4:23 pm
PT
If I didn’t want to use the slider but just wanted to reformat my visible dates to be like the ones in your screenshot (Jun 09), could I do that in a stylesheet? What would be the properties?
June 30, 2009 at 7:26 am
More jQuery demos: scrolling news, fisheye menu « Path to SharePoint
[...] For the record, the following jQuery demos are already present on the site: – Sparklines (minicharts) – Slider for the Gantt view (animation) [...]
July 13, 2009 at 3:16 pm
einmalAlles1980
Excellent solution. Thank you very much.
July 13, 2009 at 6:08 pm
TMZ
Hi Chris,
Great feature (Thank you!). How do I show months at 100% and zoom down to week intervals at 25% for example? I need to see to the week level. Thanks- T.
July 13, 2009 at 6:10 pm
TMZ
..actually I wrote that backwards- weeks at 100% and months as you drop past 50% to 25%. (sorry! )
July 21, 2009 at 8:56 pm
M.
Great work! Thank you for sharing it with the community.
Can you please show how can I reverse to the normal date (default Gantt date) format when slider is at 100%?
Thanks
M.
July 22, 2009 at 11:43 am
An example combining Gantt view and color coding « Path to SharePoint
[...] the Text to HTML Web Part to assign a color status to the task. The above screenshot utilizes the “Slider “ Web Part to facilitate a flexible view of the Gantt and the Text to HTML Web Part to add a visual status to [...]
August 11, 2009 at 3:12 am
Desiree
Hi Christophe,
Great work!
I just want to know if it has restrictions under secured site. It works on our dev site but when I did the same on production which is on https page it does not work…no linking, no animation just 100% with the loader and nothing happens when you click it…
Looking forward to your response
Cheers,
Desiree
August 16, 2009 at 4:05 am
Christophe
The script itself should work fine. Make sure that the initial calls to the jQuery libraries are not blocked in your secure environment.
August 25, 2009 at 6:20 pm
Mike
In reference to Matts post about having the timeframe start at todays date; how do I add the code? Does it go with the slider code or somewhere else? Sorry for not getting it but I’m not very good at this stuff.
September 8, 2009 at 1:21 pm
Color Coded Gantt View « Path to SharePoint
[...] start with the live demo (combined here with the Gantt slider): [...]
September 11, 2009 at 7:12 pm
Benjamin
Some people know I can change the gant view for month and not for a weeks???
September 17, 2009 at 7:28 pm
Anonymous
Hi Christophe,
I’m a great admirer of your work and am learning so much from your work.
The yellow verticle bar that indicates today’s date in the Gantt view is rather hard to see, especially if I do more to shrink the chart size. Could you suggest a way to make that more readily visible like change it’s color to red for example?
Thanks in advance.
September 20, 2009 at 10:02 pm
Josh
Hi Christophe,
I’m a bit of a newb and was wondering how to get the jquery-ui to work. I can utilize regular jquery but when I use your script all I get is the change inside the Gantt chart but the slider feature does not work. I’m pointing to where the placed the jquery-ui folder ( same place that the jquery library was installed) but still nothing. Any suggestions would be great.
Thanks in advance.
September 22, 2009 at 11:59 am
Christophe
Hard to tell Josh… Could it be that your versions of jQuery and jQuery UI are not compatible?
September 28, 2009 at 4:35 pm
Josh
Hi Christophe,
I’m using Jquery-ui 1.7.2 and Jquery 1.3. I know I have Jquery installed correctly but am not sure about the jquery-ui. Do I just have to un-zip the file and place it in a directory (which is what I’ve done)? I have my jquery install in “C:\Program Files\dir\jquery” and mu jquery-ui files in”C:\Program Files\dir\jquery-ui” and point to them both in the script. Does this sound right or am I missing anything.
Thanks again for your help.
September 23, 2009 at 6:35 pm
Dan
Your slider is amazing, however I seem to be having some issues with the days of the week showing. When the page first loads, the days will show, however when I hover over the slider, it loses the days of the week and just shows:
Sep’09 Sep ’09 Sep ’09 Sep ’09 Oct ’09 etc.
Is there a way to keep the days of the week?
Also, in IE, the above shows up as vertical text…
Thanks for any help, and again, great work!
_Dan
September 24, 2009 at 12:45 pm
Christophe
Dan, this is the expected behavior, and is done on purpose. Keeping the full date would force the column width, preventing the timeline from shrinking along with the slider.
October 5, 2009 at 4:51 pm
Brad Shook
I too would like to display the Gantt chart in Month intervals. Could this be accomplished by adding an “IF” statement something like
If interval month=last date month then skip displaying it?
October 11, 2009 at 1:05 pm
Christophe
Sure, you could do that…but you would still be working in week intervals. That’s why I prefer to keep each title.
November 11, 2009 at 6:07 pm
M. R.
>>Matt
>>I managed to get the autoscroll working, there is a slight lag on page >>load so if anyone has any suggestions on a better way to do this >>please let me know
Hi Matt,
Your code works ok in IE6 but does not work in IE8. Can you please advise?
Regards,
M.R.
November 11, 2009 at 7:03 pm
M.R.
Sorry, it’s not a browser problem.
The scroll solution (i.e. Matt scrolling, see above posting+code) works fine on a 64-bit Sharepoint site but does not work in a 32- bit Sharepoint environment. On a 32-bit Windows the following piece of code fails:
arrElements = objDIV.getElementsByTagName(“td”);
for (var i = 0; i < arrElements.length; i++) {
if (arrElements(i).className == "ms-GT") objTD = arrElements(i);
}
Class name "ms-GT" is not found and as a result objTD is always null.
Can you please advise?
Regards,
M.R.
February 7, 2010 at 7:01 pm
Robban
Any new on the “ms-GT” class issue?
December 23, 2009 at 7:51 pm
Robert
Hi I’m new and wanted to know if anyone answered the question i would to do the same thing.
Thank you for your time.
TMZ
Hi Chris,
Great feature (Thank you!). How do I show months at 100% and zoom down to week intervals at 25% for example? I need to see to the week level. Thanks- T.
Reply .July 13, 2009 at 6:10 pm
TMZ
..actually I wrote that backwards- weeks at 100% and months as you drop past 50% to 25%. (sorry! )
January 21, 2010 at 10:05 am
Prashant
Very good usage of JQuery and CWQP….I am using it for my Project mgmt website…
Thanks!!!
February 10, 2010 at 4:48 pm
Yew
Hi Chris,
Great post and love it.
The slider works but I have a problem where the Month (jan…dec) appear to be “undefined”. Am I missing something?
Can you please advice?
Yew
February 11, 2010 at 6:21 pm
Christophe
Yew, are your dates expressed as MM/DD/YYYY? If not, you’ll need to adjust the script.
February 12, 2010 at 11:35 pm
Terri H
Christophe,
During a search, I found the demo:
http://pathtosharepoint.com/Pages/GanttTimeScale.aspx
This is exactly what I’ve been looking for in terms of scaling back the gantt to a monthly view. Do you have the code associated to this available?
February 14, 2010 at 12:34 pm
Robban
+1 …. Perfect for me as well. The activies in my group are often quite long whitch makes this a perfect tool for giving a better overview.
And even better if combined with the “freeze panes” code from above whitch I manage to apply to the percentage zoom.
/Robban
February 14, 2010 at 12:37 pm
Robban
Meaning…. if there is any code availible for this zoom it would be much appriciated.
/Robban
February 14, 2010 at 4:04 pm
Paul
Wonderful! But I want to suppress the tasks below the GANTT Chart so that my Dashboard is not cluttered with tasks and the only thing you see is the GANTT.
Paul
February 16, 2010 at 3:26 pm
Terri H
Paul, the following code was part of the “color coding” solution. I think it should suppress your tasks:
//Optional: hide the list under the Gantt view
$(“.ms-summarystandardbody”).hide();
February 16, 2010 at 5:22 am
Chris
Thanks Chris, one problem when using the latest jquery ui (1.7.2) and juery lib (1.4).
I implmented your slider, changed some options to make it work, however no matter what I do, I just can not move the handle, it seems there is no “handle” in the latest UI.slider, either an option or an event.
Need your help.
Chirs
February 17, 2010 at 7:51 pm
Rob
Chris,
In reference to Terri H’s posting above, the code for the Gantt Chart Slider for the follwing link would help me out enormously as well.
http://pathtosharepoint.com/Pages/GanttTimeScale.aspx
This functionality is exactly what we are looking to accomplish for our chart.
Thanks a million for your great coding!!!
Rob
February 18, 2010 at 8:17 pm
James
Thanks Chris,
This script is awesome. I’m a complete newbie to coding so your site is a god send.
I was just wondering if there is a way of combining the Months together, as I think it would make it look a lot cleaner.
Thank You for your help.
James
February 20, 2010 at 7:05 am
Christophe
To Terri, Roban, Chris, Rob and James: we offer an upgraded version of the script – along with lots of other goodies – to the participants of our online workshop: Inline Graphs, Dynamic Charts and Enhanced Gantt Views
http://eusp-chartsandgraphs.eventbrite.com/
The jQuery team just released jQuery 1.4.2 yesterday, and I’ll upgrade all the scripts to work with this last version.
February 23, 2010 at 6:11 pm
Terri H
Thanks for the heads-up! Now let’s see if the bosses will let me have the time to attend…..
March 16, 2010 at 5:04 pm
Shayaan Faruqi
Great slider, very helpful. I’m actually trying to get it to display only “years”, as we have several projects with very long timelines, I don’t care to see the minutae but rather the broad overview. The problem is with the current way we see our gantt views, it cuts off because we have projects that started several years ago, and continue off a few years from now.
Would love to see some code to modify this for a yearly view!
Thanks!
April 9, 2010 at 3:40 pm
Marshal
Great job,
i have one question, on 25% i cannot see week view. It is always a month view. It is same behavior on your demo also.
See attached screenshot. Is this expected behavior?
http://www.freeimagehosting.net/uploads/ad167c7039.png
April 22, 2010 at 2:40 pm
Anonymous
Hi Christophe,
thank you for your great job.
I have a question: I have regional setting to “italian” and therefore date is DD-MM-YYYY, and if I use your code for showing the months value some months are not correctly displayed in the columns (I think your code is for UK settings MM-DD-YYYY).
Have you any suggestion?
thanks
Michele
April 22, 2010 at 2:41 pm
Michele
Hi Christophe,
thank you for your great job.
I have a question: I have regional setting to “italian” and therefore date is DD-MM-YYYY, and if I use your code for showing the months value some months are not correctly displayed in the columns (I think your code is for UK settings MM-DD-YYYY).
Have you any suggestion?
thanks
Michele
April 28, 2010 at 1:08 am
Christophe
You’re correct, you’ll need to tweak the code (switch days and months) to make it work with your regional settings.
May 4, 2010 at 10:57 am
Britta
Hi Christophe, thank you a lot for your very helpfully tutorials and scripts. The color code gantt view works fine but i habe problems with the slider and the month grouping. We use a german sharepoint and i have changed the date formate text as descripted. But no month is displayed only the date of each monday.
Have you any suggestion?
thanks britta
May 11, 2010 at 12:49 pm
Rajesh Mohakud
Hi Christophe,
When I am inserting the CEWP before the “ListViewWebPart” the slider is not working.
When I am inserting the CEWP after the “ListViewWebPart” the slider is working.
Why so?
I want to insert the slider before the “ListViewWebPart”. For that what I have to do.
Thanks,
Rajesh
June 4, 2010 at 3:28 am
Christophe
It should work when inserted before the Gantt view. Check that you are correctly calling jQuery, and see if there could be any conflict with other scripts on the page.
May 18, 2010 at 9:43 am
CarlaO
This is great!
There is a comment from Matt above about defaulting to Today’s date, but I cannot see the solution. I would also like it to default to Today’s date, as it currently defaults to the start date of the first project.
Any suggestions?
Thanks
Carla
May 20, 2010 at 2:26 am
Matt
Hi CarlaO,
This is how I have been doing it, if anyone has any better suggestions please respond.
window.onload = function(){
DoIt();
}
function DoIt() {
var objDIV;
var objTD;
var arrElements;
arrElements = document.getElementsByTagName(“div”);
for (var i = 0; i < arrElements.length; i++) {
if (arrElements(i).className == "ms-ganttDiv") objDIV = arrElements(i);
}
arrElements = objDIV.getElementsByTagName("td");
for (var i = 0; i < arrElements.length; i++) {
if (arrElements(i).className == "ms-GT") objTD = arrElements(i);
}
objDIV.scrollLeft = Math.round(objTD.offsetLeft – objDIV.offsetWidth / 2);
return 1;
};
Cheers,
Matt
June 10, 2010 at 2:16 pm
Lucas
Dear Matt,
Its not working in IE8 and XP 32 bits.
Any idea?
May 30, 2010 at 9:05 am
Ali
Plz .. can anyone show me how to change the Gantt view to quarter instead of month. Thanks
June 10, 2010 at 3:25 pm
Lucas
Dear Matt and CarlaO,
Here a Code that works to auto-scroll in a sharepoint Gantt View to today’s date.
http://www.iotap.com/Blogs/tabid/277/EntryId/155/Scrolling-to-Today-rsquo-s-date-in-Sharepoint-Gantt-Chart.aspx
June 14, 2010 at 9:04 pm
RobH
I am using this in SharePoint 2010, and I get the Slider to show in the page in the CEWP, and the slider seems to work fine, but it doesn’t change the gantt view in the least bit. Have you tried this in 2010? Was there some change in 2010 that I need to modify the script for? I have searched high and low for a solution like this, and it always comes back to your script, which would be great if I could get it to work.
I’ve tried moving it above and below the gantt, tried deleting and recreating the CEWP, tried linking it to the CEWP instead of pasting the code into the CEWP, still get the same results.
Any help would be greatly appreciated.
Thanks.
June 15, 2010 at 9:03 am
Christophe
Rob, this code is for SP 2007 only. Wondering why you would need this in SP 2010, as the default Gantt view has a resizing option.
June 16, 2010 at 2:31 pm
RobH
I didn’t know what you were talking about until after you replied here. I went back and found it. I never saw it before. It DOES have a ‘zoom in’, ‘zoom out’, and ‘scroll to task’ function in the ribbon that I didn’t see before. Amazing how you miss things that are right in front of your face sometimes…
Thanks for pointing out my collective blindness!
Great site by the way. I am currently supporting 2007 and 2010, so some of your solutions are still useful to me, and work well.
Thanks for being a resource!
~Rob
July 10, 2010 at 12:26 pm
Carlo
Hi Christophe,
The slider is great. I also got the color coded Gantt view but I cannot combine them.
The Slider script is above the Gantt but if I add a CEWP below the Gantt to color code the bars, the slider will not work. Is there something I should be adding in between?
Carlo
July 26, 2010 at 2:59 pm
Veti
Hello Christophe
I tried this on my SP 2007 setup, it doesn’t work with IE 8 but it does with chrome. our site is currently setup as https, could that be causing this issue?
any tips would be greatly appreciated.
Thank you
V
July 28, 2010 at 2:02 am
Varun
Hello Christophe,
Any way to get the code for the following link? I know you said we needed to participate in a course but it’s expired. Thanks!
http://pathtosharepoint.com/Pages/GanttTimeScale.aspx
August 16, 2010 at 3:58 pm
Fred
As Varun said, course has expired. When is the next one, or can you post the code? I tried to colspan the months so they do not repeat, but the progress bars do not reflect the correct start/end period.
Thanx