为IterationPlanningBoardApp代码生成窗口/渲染帧

时间:2016-06-23 20:02:24

标签: javascript rally code-rally

我一直致力于在汇总维基上展示和迭代计划板。总的来说它正在工作,但是当维基页面启动时,该板将占据整个网页。此代码与我触及的其他代码不同,因此不确定生成框架/窗口大小以限制或减小电路板大小的方法。我的代码位于......

之下

谢谢! 标记

(function(){     var Ext = window.Ext4 || window.Ext;

Ext.define('Rally.apps.iterationplanningboard.IterationPlanningBoardApp', {
    extend: 'Rally.app.App',
    requires: [
        'Rally.ui.gridboard.planning.TimeboxGridBoard',
        'Rally.ui.gridboard.plugin.GridBoardAddNew',
        'Rally.ui.gridboard.plugin.GridBoardManageIterations',
        'Rally.ui.gridboard.plugin.GridBoardCustomFilterControl'
    ],
    mixins: ['Rally.app.CardFieldSelectable'],
    modelNames: ['User Story', 'Defect'],
    helpId: 272,
    config: {
        defaultSettings: {
            cardFields: 'Parent,Tasks,Defects,Discussion,PlanEstimate'
        }
    },

    getContext: function () {
        var c = this.callParent();
        c.map.map.project = {"_ref":"/project/51186097359"};
        return c;
    },

    launch: function() {
        var context = this.getContext(),
            plugins = [
            {
                ptype: 'rallygridboardaddnew',
                rankScope: 'BACKLOG',
                addNewControlConfig: {
                    stateful: true,
                    stateId: context.getScopedStateId('iteration-planning-add-new')
                }
            },
            {
                ptype: 'rallygridboardcustomfiltercontrol',
                filterControlConfig: {
                    margin: '3 9 3 30',
                    blackListFields: ['Iteration', 'PortfolioItem'],
                    modelNames: this.modelNames,
                    stateful: true,
                    stateId: context.getScopedStateId('iteration-planning-custom-filter-button')
                },
                showOwnerFilter: true,
                ownerFilterControlConfig: {
                    stateful: true,
                    stateId: context.getScopedStateId('iteration-planning-owner-filter')
                }
            }
        ];

        if (context.getSubscription().isHsEdition() || context.getSubscription().isExpressEdition()) {
            plugins.push('rallygridboardmanageiterations');
        }

        this.gridboard = this.add({
            xtype: 'rallytimeboxgridboard',
            context: context,
            modelNames: this.modelNames,
            timeboxType: 'Iteration',
            plugins: plugins,
            cardBoardConfig: {
                cardConfig: {
                    fields:  this.getCardFieldNames()
                },
                columnConfig: {
                    additionalFetchFields: ['PortfolioItem']
                },
                listeners: {
                    filter: this._onBoardFilter,
                    filtercomplete: this._onBoardFilterComplete,
                    scope: this
                }
            },
            listeners: {
                load: this._onLoad,
                toggle: this._publishContentUpdated,
                recordupdate: this._publishContentUpdatedNoDashboardLayout,
                recordcreate: this._publishContentUpdatedNoDashboardLayout,
                preferencesaved: this._publishPreferenceSaved,
                scope: this
            }
        });
    },

    getSettingsFields: function () {
        var fields = this.callParent(arguments);
        this.appendCardFieldPickerSetting(fields);
        return fields;
    },

    _onLoad: function() {
        this._publishContentUpdated();
        if (Rally.BrowserTest) {
            Rally.BrowserTest.publishComponentReady(this);
        }
    },

    _onBoardFilter: function() {
       this.setLoading(true);
    },

    _onBoardFilterComplete: function() {
       this.setLoading(false);
    },

    _publishContentUpdated: function() {
        this.fireEvent('contentupdated');
    },

    _publishContentUpdatedNoDashboardLayout: function() {
        this.fireEvent('contentupdated', {dashboardLayout: false});
    },

    _publishPreferenceSaved: function(record) {
        this.fireEvent('preferencesaved', record);
    }
});

})();

0 个答案:

没有答案