繁体   English   中英

如何在Project Server 2013上强制执行Project Center视图?

[英]How to force a Project Center View on Project Server 2013?

我希望每当用户访问带有Project Center Webpart的特定页面时,都应该已经设置(强制执行)其“视图”,例如“摘要”,“收益值”等。

我知道该视图绑定到用户的上一次会话,因此如果用户在上次访问期间将视图更改为“ Earned Value”,则下一个将是“ Earned value”。

我如何强制用户每次使用Project Center Webpart打开页面时,她总是打开“摘要”视图?

谢谢。

这是我写的一个JavaScript解决方案,它使用查询字符串参数“ viewuid”(用于视图的GUID)来设置视图

var projCenterExt;
var JsGridSatellite;

_spBodyOnLoadFunctionNames.push("projCenterChangeView")

function projCenterChangeView() 
{
   if (window.location.search.toLowerCase().indexOf("viewuid") >= 0)
   {
      var JsGridViewUid = window.location.search.toLowerCase().split("viewuid=")[1].split("&")[0];

      if (typeof projectCenterComponent !== 'undefined')
      {
         if (typeof JsGridSatellite === 'undefined') JsGridSatellite = projectCenterComponent.get_GridSatellite();

         JsGridSatellite.LoadNewView({uid: JsGridViewUid});
      }
   }
}

谢谢爸爸丹尼尔。 您已使我们开始,但这仅在Chrome中有效。 我们必须在其中添加一个暂停,然后才能在IE中使用它。为了清楚起见,您需要找到要显示的视图的GUID,并在超链接中使用它。

这是我的示例http://projectserver/PWA/SitePages/ITDDash.aspx?idViewUID = 38f25d41-2391-4ed4-b84e-2befec36b80b

 var projCenterExt; var JsGridSatellite; _spBodyOnLoadFunctionNames.push("projCenterChangeView") //console.debug("before projCenterChangeView"); function projCenterChangeView() { //alert("in projCenterChangeView"); //console.debug("before 3 secs"); setTimeout(function(){ //alert("in if:"+window.location.search.toLowerCase().indexOf("viewuid") ); if (document.location.search.toLowerCase().indexOf("viewuid") >= 0) { var JsGridViewUid = document.location.search.toLowerCase().split("viewuid=")[1].split("&")[0]; //alert("in if:"+JsGridViewUid ); if (typeof projectCenterComponent !== 'undefined') { if (typeof JsGridSatellite === 'undefined'){ //console.debug("JsGridSatellite kis undefined"); JsGridSatellite = projectCenterComponent.get_GridSatellite(); //alert("jjc test"); } JsGridSatellite.LoadNewView({uid: JsGridViewUid}); //orig } //JsGridSatellite.LoadNewView({uid: JsGridViewUid}); } //console.debug("after 3 secs"); }, 1000); //alert("at end"); } 

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM