Rally Grid中的拖放问题

时间:2014-11-06 17:30:46

标签: javascript rally appsdk2

我最近实施的Rally Grid存在问题。

_CreatePSIObjectiveGrid: function(myStore) {
    if (!this.objGrid) {
        var colCfgs = [{
            text: 'ID',
            dataIndex: 'DragAndDropRank',
            width: 50
        }, {
            text: 'Summary',
            dataIndex: 'Name',
            flex: 1
        }, {
            text: 'Success Rate',
            dataIndex: 'c_SuccessRate',
            width: 200
        }];

        if (!this.getSetting("useSuccessRatioOnly")) {
            colCfgs.push({
                text: 'Initial Business Value',
                dataIndex: 'PlanEstimate',
                width: 200
            });

            colCfgs.push({
                text: 'Final Business Value',
                dataIndex: 'c_FinalValue',
                width: 200
            });
        }

        this.objGrid = Ext.create('Rally.ui.grid.Grid', {
            store : myStore,
            enableRanking: true,
            defaultSortToRank: true,
            height: 550,
            overflowY: 'auto',
            margin: 10,
            showPagingToolbar: false,
            columnCfgs : colCfgs
        });

        Ext.getCmp('c-panel-obj-crud-table').add(this.objGrid);
    }
}

虽然我已将“enableRanking”设置为“true”,但如果我将网格添加到组件,则排名拖放不起作用。但是,如果我从

更改最后一个语句,拖放功能确实可以正常工作
Ext.getCmp('c-panel-obj-crud-table').add(this.objGrid);

this.add(this.objGrid);

我不知道这是否是Rally错误。尝试比较生成的最终html文件,找不到任何线索。

1 个答案:

答案 0 :(得分:0)

this few sec video shows下面的代码,其中可排名网格被添加到子面板,而不是直接添加到thisthis指向应用程序的全局范围)仍然保留了重新排队的能力:

Ext.define('CustomApp', {
    extend: 'Rally.app.App',
    componentCls: 'app',
    launch: function() {
        var panel = Ext.create('Ext.panel.Panel', {
            layout: 'hbox',
            itemId: 'parentPanel',
            componentCls: 'panel',
            items: [
                {
                xtype: 'panel',
                title: 'Panel 1',
                width: 600,
                itemId: 'childPanel1'
                },
                {
                xtype: 'panel',
                title: 'Panel 2',
                width: 600,
                itemId: 'childPanel2'
                }
            ],
        });
        this.add(panel);
        this.down('#childPanel1').add({
            xtype: 'rallygrid',
            columnCfgs: [
                'FormattedID',
                'Name',
                'ScheduleState',
                'Owner'
            ],
            context: this.getContext(),
            enableRanking: true,
            defaultSortToRank: true,
            storeConfig: {
                model: 'userstory'
            }
        });
    }
});
相关问题