【问题标题】:Rally 2.0 SDK - Filter User Stories for each ProjectRally 2.0 SDK - 过滤每个项目的用户故事
【发布时间】:2013-07-30 19:38:52
【问题描述】:

我想为我在 Rally 中拥有的每个项目过滤用户故事,而不仅仅是当前选择的项目。有可能吗?

【问题讨论】:

    标签: rally


    【解决方案1】:

    此代码使用了 rallyprojectpicker 并根据项目选择刷新了网格:

    <!DOCTYPE html>
    <html>
    <head>
        <title>Stories By Project</title>
    
        <script type="text/javascript" src="https://rally1.rallydev.com/apps/2.0rc1/sdk.js"></script>
    
        <script type="text/javascript">
            Rally.onReady(function() {
                Ext.define('CustomApp', {
                    extend: 'Rally.app.App',
                    componentCls: 'app',
    
                    items: [
                        {
                            xtype: 'container',
                            itemId: 'projFilter'
                        },
                        {
                            xtype: 'container',
                            itemId: 'grid'
                        }
                    ],
    
                    launch: function() {
    
                        this.down('#projFilter').add({
                xtype: 'rallyprojectpicker',
                            itemId: 'projPicker',
                workspace: '/workspace/12352608129',
                value: '/project/12527515559',  //default
                            listeners: {
                                change: this._onProjectChange,
                                scope: this
                            }
                        });
                    },
    
            _onProjectChange: function()
            {
                if(!this.model) {
                    this._retrieveModel();
                } else {
                    this._refreshGrid();
                }
            },
    
                    _retrieveModel: function(comboBox) {
                        Rally.data.ModelFactory.getModel({
                            type:'UserStory',
                            success:this._onModelRetrieved,
                            scope: this
                        });
                    },
    
                    _refreshGrid: function() {
                this.grid.reconfigure(this._buildStore());
                    },
    
            _buildStore: function() {
               return Ext.create('Rally.data.WsapiDataStore', {
                   model: this.model,
                   autoLoad: true,
                   context: {
                       projectScopeUp: false,
                       projectScopeDown: false,
                       project: this.down('#projPicker').getValue()
                   }
             });
            },
    
                    _onModelRetrieved: function(model) {
                this.model = model;
                        this.grid = this.down('#grid').add({
                              xtype:'rallygrid',
                  store: this._buildStore(),
                              columnCfgs:[
                                  'FormattedID',
                                  'Name'
                              ]
    
                        });
                    }
                });
    
                Rally.launchApp('CustomApp', {
                    name: 'Stories By Project'
                });
            });
        </script>
    
        <style type="text/css">
        </style>
    </head>
    <body></body>
    </html>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多