2011-12-12 212 views
1

我試圖用第二個下拉菜單擴展故事板應用程序。我怎樣才能將兩個查詢合併(並)爲一個?如何將兩個查詢對象合併爲一個?

我試圖至今:

  //Build query based on iteration dropdown 
       var q1 = new rally.sdk.util.Query(); 
       q1.query = dropdown.getQueryFromSelected(); 

       var q2 = new rally.sdk.util.Query(); 
       q2.query = dropdown2.getQueryFromSelected(); 

       var qObj = q1.and(q2); 

       cardboardConfig.query = qObj.query;      

      if (!cardboard) { 
       if (cardboardConfig.types.length === 0) { 
        userStoriesCheckBox.setChecked(true); 
        cardboardConfig.types.push(userStoriesCheckBox.getValue()); 
       } 
       cardboard = new rally.sdk.ui.CardBoard(cardboardConfig, rallyDataSource); 
       cardboard.display("storyBoard"); 
      } else { 
       cardboard.refresh(cardboardConfig); 
      } 

回答

2

所有應用程序SDK組件和實用程序都記錄在這裏: http://developer.rallydev.com/help/app-sdk

迭代/釋放下拉的getQueryFromSelected方法返回一個rally.sdk.util.Query對象,它可以直接與運算:

cardboardConfig.query = dropdown.getQueryFromSelected() 
    .and(dropdown2.getQueryFromSelected()); 

請注意,您還可以創建查詢作爲字符串:

var query = new rally.sdk.uil.Query('ScheduleState = "Accepted"');