Issue with rallygrid column width in rc2

2019-08-15 01:18发布

Appsdk2 rc2 seems to be ignoring the width parameter on columnCfgs for rallygrids.

For example:

xtype: 'rallygrid',
columnCfgs: [
    {dataIndex: 'ValueScore', width: 40, text:'Value'}
]

This renders with a 40 pixel width in rc1, but does not in rc2. Is this a bug, or has the parameter changed? Is there a solution for this?

标签: rally appsdk2
2条回答
放我归山
2楼-- · 2019-08-15 01:52

It looks like the bug does not affect grids based on a custom store. Here is an rc2 app (you may see the full code here) with Rally.data.custom.Store where width specified in the clumnCfgs has an expected effect:

  _createTestSetGrid: function(testsets) {
        var testSetStore = Ext.create('Rally.data.custom.Store', {
                data: testsets,
                pageSize: 100,  
            });
        if (!this.down('#testsetgrid')) {
         this.grid = this.add({
            xtype: 'rallygrid',
            itemId: 'testsetgrid',
            store: testSetStore,
            columnCfgs: [
                {
                   text: 'Formatted ID', dataIndex: 'FormattedID', xtype: 'templatecolumn',
                    tpl: Ext.create('Rally.ui.renderer.template.FormattedIDTemplate')
                },
                {
                    text: 'Test Case Count', dataIndex: 'TestCaseCount',
                },
                {
                    text: 'Test Case Status', dataIndex: 'TestCaseStatus', width: 200,           //width: 40
                },
                {
                    text: 'TestCases', dataIndex: 'TestCases', 
                    renderer: function(value) {
                        var html = [];
                        Ext.Array.each(value, function(testcase){
                            html.push('<a href="' + Rally.nav.Manager.getDetailUrl(testcase) + '">' + testcase.FormattedID + '</a>')
                        });
                        return html.join(', ');
                    }
                }
            ]
        });
         }else{
            this.grid.reconfigure(testSetStore);
         }
    }

With width set to 200 TestCasesStatus column looks like this:

enter image description here

and with width set to 40 like this:

enter image description here

查看更多
等我变得足够好
3楼-- · 2019-08-15 01:56

This is a bug in the 2.0rc2 release. For now it can be worked around by including flex: null in your column config to override what the grid is doing incorrectly:

xtype: 'rallygrid',
columnCfgs: [
    {dataIndex: 'ValueScore', width: 40, text:'Value', flex: null}
]

A defect has been submitted and this should be fixed for the next release.

查看更多
登录 后发表回答