簡體   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