Pages

Thursday, January 27, 2011

Scroll Today’s date in Sharepoint Gantt Chart

Though the out of the box Gantt chart in Sharepoint is easy to setup and use, it has some drawbacks as well. One such drawback is that chart always starts from the start of the project and to go to Today’s date lot of scrolling will be required.
We have created a work around for this using JQuery and the ScrollTo plug-in. The idea we have used is to locate the Today’s cell using JQuery and then scroll to the cell using the ScrollTo plug-in code. Below are the steps that explains the process
1. Download the ScrollTo plug-in from http://plugins.jquery.com/project/ScrollTo
2. Add jquery.scrollTo.js file to a Sharepoint document library
3. Add a content editor webpart to the page that has the Sharepoint Gantt chart. Make sure that the content editor webpart is added after the Gantt chart.
4. Add the below code in the source editor of the content editor webpart
 

5. Make sure to change the path of jquery.scrollTo.js to a location with your Sharepoint
6. Now when the Gantt chart is viewed it will scroll to Today’s date
Sharepoint Gantt Chart