0

反復によってフィルター処理されたユーザー ストーリーのグリッドを構築するアプリを作成しました。動作しているようで、エラーはありませんが、ストーリーのリストは不完全です。一部のイテレーションでは、ストーリーの半分がグリッドにありません。すべてのストーリーは同じプロジェクトにあります。私は何を間違っていますか?以下のコードを改善する方法について提案がある場合は、お知らせください。ありがとう!

<!DOCTYPE html>
    <html>
        <head>
            <title>StoriesByIteration</title>
            <script type="text/javascript" src="/apps/2.0rc1/sdk.js"></script>
            <script type="text/javascript">
                Rally.onReady(function () {
                    Ext.define('CustomApp', {
                        extend: 'Rally.app.TimeboxScopedApp',
                        componentCls: 'app',
                        scopeType: 'iteration',
                        comboboxConfig: {
                            labelWidth: 100,
                            width: 300
                        },

                        addContent: function() {
                            this._makeStore();
                        },

                        onScopeChange: function() {
                            this._makeStore();
                        },

                         _makeStore: function(){
                             Ext.create('Rally.data.WsapiDataStore', {
                                model: 'UserStory',
                                fetch: ['FormattedID','Name'],
                                autoLoad: true,
                                filters: [this.getContext().getTimeboxScope().getQueryFilter()],
                                listeners: {
                                    load: this._onDataLoaded,
                                    scope: this
                                }
                            }); 
                        },

                        _onDataLoaded: function(store, data){
                            var stories = [];
                            Ext.Array.each(data, function(story) {
                                var s  = {
                                    FormattedID: story.get('FormattedID'),
                                    Name: story.get('Name'),
                                };
                                this._createGrid(stories);
                                stories.push(s);
                            }, this);
                        },             

                        _createGrid: function(stories) {
                            var myStore = Ext.create('Rally.data.custom.Store', {
                                data: stories,
                                pageSize: 100,  
                            });

                            if (!this.grid) {
                                this.grid = this.add({
                                    xtype: 'rallygrid',
                                    store: myStore,
                                    columnCfgs: [
                                        {
                                           text: 'Formatted ID', dataIndex: 'FormattedID', xtype: 'templatecolumn',
                                            tpl: Ext.create('Rally.ui.renderer.template.FormattedIDTemplate')
                                        },
                                        {
                                            text: 'Name', dataIndex: 'Name'
                                        }
                                    ]
                                });
                            } else {
                            this.grid.reconfigure(myStore);
                            }
                        }
                    });

                    Rally.launchApp('CustomApp', {
                        name:"StoriesByIteration",
                    });
                });
            </script>
            <style type="text/css">
                .app { }
            </style>
        </head>
    <body></body>
</html>
4

1 に答える 1

0

移動する必要があります

this._createGrid(stories);

ループの外側:

 _onDataLoaded: function(store, data){
                var stories = [];
                Ext.Array.each(data, function(story) {
                            var s  = {
                                FormattedID: story.get('FormattedID'),
                                Name: story.get('Name'),
                            };
                            stories.push(s);
                }, this);
                this._createGrid(stories);
    },    
于 2013-07-18T15:04:49.467 に答える