2014-06-24 16 views
0

我正在使用rallysolrartifactchooserdialog來顯示主動選取器。但是,填充網格的計劃只能在Rally默認的項目範圍內進行。有沒有辦法配置這個來獲取所有的舉措?從Rally Solr移除作用域神器選擇器對話框

{ 
     xtype: 'rallysolrartifactchooserdialog', 
     id: 'portfolioItemPicker', 
     artifactTypes: ['portfolioitem/initiative'], 
     autoShow: true, 
     height: 250, 
     title: 'Choose an Initiative', 
     listeners: { 
      scope: this, 
      artifactChosen: function(picker, selectedRecord) { 
       ... 
      } 
     } 
} 

我注意到文檔中的storeConfig參數 - 也許這是解決方案嗎?

回答

0

你在正確的軌道上。您可以通過在storeConfig上下文控制工件的作用域:

storeConfig: { 
    context: { 
     //specify the workspace to search 
     workspace: Rally.util.Ref.getRelativeUri(this.getContext().getWorkspace()), 

     //all projects 
     project: null 
    } 
} 

順便說一句,如果您正在使用2.0rc3相應的事件實際上是artifactchosen(全部小寫)。我將修復文檔示例以反映...

+0

因爲這只是我自定義應用程序中的一個項目,所以'this'沒有'getContext()'函數 - 如果我刪除內部的'this。 getContext()。getWorkspace()'它完美的工作 –

+0

很酷。只要你只有一個工作區,你應該沒問題。否則你會想要通過工作區。你需要從應用程序傳遞組件鏈上下文,或者只是使用Rally.environment.getContext()。getWorkspace() –

+0

不幸的是,這也不適合我!沒有'Rally.environment.getContext()' - 儘管有'Rally.env',但它沒有'getContext()'方法,或者 –