如何将两个查询对象合并为一个?

时间:2011-12-12 14:52:23

标签: javascript rally

我正在尝试使用第二个下拉菜单扩展故事板应用程序。如何将两个查询合并(AND)为一个?

到目前为止我的尝试:

            //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);
            } 

1 个答案:

答案 0 :(得分:2)

此处记录了所有App 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"');