SharePoint 2010-如何使甘特图视图默认为今天? [英] SharePoint 2010 - How to get Gantt view to default to todays date?

查看:116
本文介绍了SharePoint 2010-如何使甘特图视图默认为今天?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我已经基于大型任务列表填充了多个甘特图.该列表要求保留旧任务,即使是已经完成的任务.

So i've populated a number of gantt views based on a large task list. This list has a requirement to keep old task, even those already completed.  

不幸的是,甘特视图始终从2016年的第一个任务开始就开放.

Unfortunately the gantt view always open to the date of the very first task, back in 2016. 

我如何配置甘特图,以便在打开时可以打开或自动滚动到今天的日期?

我对SharePoint相对较新,希望获得一些指导.

I am relatively new to SharePoint and would appreciate a bit of guidance.  

谢谢

推荐答案

将以下代码添加到甘特视图"页面的内容编辑器Web部件中.

Add the following code into a content editor web part in the Gantt View page.

<script src="//code.jquery.com/jquery-1.12.4.js" type="text/javascript"></script>
<script type="text/javascript">
SP.SOD.executeOrDelayUntilScriptLoaded(ScrollToToday,'jsgrid.js');
function ScrollToToday(){
	setTimeout(function(){


("div [id


='_ ListViewWebPartJSGrid']"))[0] .jsgrid.ScrollGanttToDate(新的Date()); },1000); } </script>
='_ListViewWebPartJSGrid']")[0].jsgrid.ScrollGanttToDate(new Date()); }, 1000); } </script>

最好的问候,

丹尼斯


这篇关于SharePoint 2010-如何使甘特图视图默认为今天?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆