2012-07-19 82 views
1

我想只顯示故事/從看板式板當前迭代的缺陷,以幫助我們的過程。拉力賽自定義看板

所以我發現了這個例子在這裏的SO,並添加了查詢行過濾掉我的迭代。但現在我想要這個來自拉力賽提供的迭代下拉框。

我把它添加到屏幕上,它顯示了不錯,但實際上,我怎麼把它掛到我的查詢?

<!DOCTYPE html> 
    <html> 
    <head> 
    <title>My Custom App</title> 

    <!--Include SDK--> 
    <script type="text/javascript" src="https://rally1.rallydev.com/apps/2.0p/sdk.js"></script> 

    <!--App code--> 
    <script type="text/javascript"> 

     Rally.onReady(function() { 

      Ext.define('CustomApp', { 
       extend: 'Rally.app.App', 
       componentCls: 'app', 
       mappedToField:"State", 
       mappedFromField:"KanbanState", 

       fieldNameMap:{ 
        a:"New", 
        b:"New", 
        c:"Defined", 
        d:"In-Progress", 
        e:"In-Progress", 
        f:"Completed", 
        g:"Completed", 
        h:"Accepted" 
       }, 

       launch: function() { 
        this.add({ 
         xtype:'rallyiterationcombobox', 
         itemId: 'iterationComboBox', 
        }); 

        this.add({ 
         xtype:'rallycardboard', 
         types: ["Defect", "HierarchicalRequirement"], 
         query: 'Iteration.Name contains "UB Sprint 29"', 
         attribute: this.mappedFromField, 
         listeners:{ 
          beforecarddroppedsave:function(cardboard, card) { 
           //map the new state from on this card to the new state 
           var newState = this.fieldNameMap[card.record.get(this.mappedFromField)]; 
           card.record.set(this.mappedToField, newState); 
          }, 
          scope:this 
         } 
        }); 
       } 
      }); 

      Rally.launchApp('CustomApp', { 
       name: 'My Custom App' 
      }); 

     }); 

    </script> 


    </head> 
    <body class="myApp"> 
    </body> 
    </html> 

回答

0

如果要通過反覆篩選,你需要一個監聽器添加到iteration combobox,並將它創建基於當前選擇的迭代板。

<!DOCTYPE html> 

我的看板通過迭代

<!--Include SDK--> 
<script type="text/javascript" src="https://rally1.rallydev.com/apps/2.0p2/sdk.js"></script> 

<!--App code--> 
<script type="text/javascript"> 

    Rally.onReady(function() { 

     Ext.define('CustomApp', { 
      extend: 'Rally.app.App', 
      componentCls: 'app', 
      mappedToField:"State", 
      mappedFromField:"KanbanState", 

      kanban:undefined, 
      fieldNameMap:{ 
       a:"New", 
       b:"New", 
       c:"Defined", 
       d:"In-Progress", 
       e:"In-Progress", 
       f:"Completed", 
       g:"Completed", 
       h:"Accepted" 
      }, 

      launch: function() { 
       this.add({ 
        xtype:'rallyiterationcombobox', 
        itemId: 'iterationComboBox', 
        listeners: { 
         select: this.createKanban, 
         ready: this.createKanban, 
         scope: this 
        } 
       }); 
      }, 
      createKanban:function(combo, records) { 
       if (this.kanban) { 
        this.kanban.destroy(); 
       } 
       var filters = []; 
       if (records.length) { 
        filters.push({ 
         property: 'Iteration', 
         value: records[0].get("_ref") 
        }); 
       } 
       this.kanban = this.add({ 
        xtype:'rallycardboard', 
        types: ["Defect", "HierarchicalRequirement"], 
        attribute: this.mappedFromField, 
        listeners:{ 
         beforecarddroppedsave:function(cardboard, card) { 
          //map the new state from on this card to the new state 
          var newState = this.fieldNameMap[card.record.get(this.mappedFromField)]; 
          card.record.set(this.mappedToField, newState); 
         }, 
         scope:this 
        }, 
        storeConfig:{ 
         filters:filters 
        } 
       }); 
      } 
     }); 

     Rally.launchApp('CustomApp', { 
      name: 'My Kanban by Iteration' 
     }); 

    }); 

</script> 

+0

感謝查爾斯,我得到了這個工作:)欣賞你幫助我們全力以赴。當我得到這一切,雖然我沒有像缺省看板板那樣的卡上的缺陷/任務。我環顧四周尋找其他可能有這種卡的CardConfigs,但只能看到rallyartifcatcard,它不會顯示它們。有沒有一種方法可以使用拉力賽卡用來獲取這些信息的看板卡?再次感謝 – user1537867 2012-07-27 16:14:54

+0

您正在查看的卡適用於SDK 1.0主板。下一個版本的AppSDK 2.0應該具有更好的卡功能。如果您不想自己複製它,您可能需要等待我們完成發佈。 – 2012-08-02 16:16:40

+0

我挖掘了一下之後我才明白這一點:)感謝您的幫助! – user1537867 2012-08-07 19:05:43