首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >rc2中的rallygrid列宽度问题

rc2中的rallygrid列宽度问题
EN

Stack Overflow用户
提问于 2014-01-08 18:45:54
回答 2查看 152关注 0票数 1

Appsdk2 rc2似乎忽略了rallygrids在columnCfgs上的宽度参数。

例如:

代码语言:javascript
复制
xtype: 'rallygrid',
columnCfgs: [
    {dataIndex: 'ValueScore', width: 40, text:'Value'}
]

这在rc1中以40像素的宽度呈现,但在rc2中不呈现。这是一个bug,还是参数发生了更改?有什么解决办法吗?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2014-01-08 20:25:41

这是2.0rc2版本中的一个bug。现在,可以通过在列配置中包含flex: null来覆盖网格正在做的错误操作:

代码语言:javascript
复制
xtype: 'rallygrid',
columnCfgs: [
    {dataIndex: 'ValueScore', width: 40, text:'Value', flex: null}
]

已经提交了一个缺陷,应该在下一个版本中修复它。

票数 1
EN

Stack Overflow用户

发布于 2014-01-08 20:25:57

看起来该bug不影响基于自定义存储的网格。下面是一个rc2应用程序(您可以看到完整的代码这里),其中Rally.data.custom.Store中指定的宽度具有预期的效果:

代码语言:javascript
复制
  _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,像这样:

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/21004026

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档