首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在Project Server 2013上强制项目中心视图?

如何在Project Server 2013上强制项目中心视图?
EN

Stack Overflow用户
提问于 2016-05-10 02:22:42
回答 2查看 980关注 0票数 0

我希望,每当用户访问某个页面与项目中心的her部件,她应该已经设置了她的视图(强制),例如。“汇总”、“挣值”等。

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

如何强制用户每次使用Project Center webpart打开页面时,都会打开“摘要”视图?

谢谢。

EN

回答 2

Stack Overflow用户

发布于 2016-11-04 04:38:24

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

代码语言:javascript
复制
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});
      }
   }
}
票数 0
EN

Stack Overflow用户

发布于 2017-06-22 04:39:23

谢谢丹尼尔爸爸。你让我们开始了,但这只能在Chrome中工作。我们必须在其中添加一个暂停,然后它就可以工作了。为了清楚起见,你需要找到你想要显示的视图的GUID,并在你的超链接中使用它。

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

代码语言:javascript
复制
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");
}

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/37122841

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档