-->

问题与RC2 rallygrid列宽(Issue with rallygrid column wid

2019-10-19 04:32发布

Appsdk2 RC2似乎无视columnCfgs为rallygrids宽度参数。

例如:

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

这使得在RC1 40像素宽度,但在RC2没有。 这是一个错误,或者已经在参数变化? 是否有一个解决方案?

Answer 1:

这是2.0RC2版本的bug。 现在可以通过包括Flex来工作围绕:空在列中的配置覆盖哪些电网正在做正确:

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

的缺陷已提交,这应该是固定的下一个版本。



Answer 2:

它看起来像错误不会影响基于自定义存储网格。 下面是一个RC2的应用程序(您可能会看到完整的代码在这里 )与Rally.data.custom.Store其中在clumnCfgs指定的宽度有一个预期的效果:

  _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);
         }
    }

随着宽度设置为200 TestCasesStatus列如下:

并与宽度设置为40这样的:



文章来源: Issue with rallygrid column width in rc2
标签: rally appsdk2