UserStory ScheduleState отображать в сетке - PullRequest
0 голосов
/ 15 мая 2018

Я пытаюсь отобразить ScheduleState для UserStories в сетке.Я не могу отобразить ScheduleState как редактируемую панель, как мы видим в Rally, с столбцами-столбцами DPCA для каждого состояния.

Например, для примера SimpleTreeGrid по ссылке ниже показано состояние графика пользовательской истории в виде столбцов-столбцов DPCA.,https://help.rallydev.com/apps/2.1/doc/#!/example/simple-tree-grid

Код указан ниже.

    <!DOCTYPE html>
    <html>
    <head>
    <title>Custom Store Grid Example</title>

    <script type="text/javascript" src="/apps/2.1/sdk.js"></script>

    <script type="text/javascript">
        Rally.onReady(function() {
            Ext.define('Rally.example.CustomStoreGrid', {
                extend: 'Rally.app.App',
                componentCls: 'app',

                launch: function() {
                console.log('launch');
                    Ext.create('Rally.data.wsapi.Store', {
                        model: 'userstory',
                        autoLoad: true,
                        listeners: {
                            load: this._onDataLoaded,
                            scope: this
                        },
                        fetch: ['FormattedID', 'ScheduleState', 'ScheduleStatePrefix' ]
                    });
                },

                _onDataLoaded: function(store, data) {
                    console.log('_onDataLoaded data', data);
                    this.add({
                        xtype: 'rallygrid',
                        showPagingToolbar: false,
                        showRowActionsColumn: false,
                        editable: false,
                        store: Ext.create('Rally.data.custom.Store', {
                            data: data
                        }),
                        columnCfgs: [
                            {
                                xtype: 'templatecolumn',
                                text: 'ID',
                                dataIndex: 'FormattedID',
                                width: 100,
                                tpl: Ext.create('Rally.ui.renderer.template.FormattedIDTemplate')
                            },
                            {
                                text: 'Prefix',
                                dataIndex: 'ScheduleStatePrefix',
                                xtype: 'templatecolumn',
                                tpl: Ext.create('Rally.ui.renderer.template.ScheduleStateTemplate', { field: 'ScheduleStatePrefix'}),
                            },
                            {
                                text: 'State',
                                dataIndex: 'ScheduleState',
                                xtype: 'templatecolumn',
                                tpl: Ext.create('Rally.ui.renderer.template.ScheduleStateTemplate', { field: 'ScheduleState'}),
                            }
                        ]
                    });
                }
            });


            Rally.launchApp('Rally.example.CustomStoreGrid', {
              name: 'Custom Store Grid Example'
            });
        });
    </script>

    <style type="text/css">

    </style>
</head>
<body></body>
</html>

1 Ответ

0 голосов
/ 22 мая 2018

Это должен быть магазин на заказ?

Если нет, то работает следующее _onDataLoaded:

            _onDataLoaded: function(store, data) {
                console.log('_onDataLoaded data', data);
                this.add({
                    xtype: 'rallygrid',
                    showPagingToolbar: false,
                    showRowActionsColumn: false,
                    editable: true,
                    store: store,
                    columnCfgs: [
                        {
                            text: 'ID',
                            dataIndex: 'FormattedID',
                            width: 100
                        },
                        {
                            text: 'Prefix',
                            dataIndex: 'ScheduleStatePrefix'
                        },
                        {
                            text: 'State',
                            dataIndex: 'ScheduleState'
                        }
                    ]
                });
            }
        });
...