Appsdk2 rc2 似乎忽略了用于 rallygrids 的 columnCfgs 上的宽度参数。
例如:
xtype: 'rallygrid',
columnCfgs: [
{dataIndex: 'ValueScore', width: 40, text:'Value'}
]
这在 rc1 中以 40 像素宽度呈现,但在 rc2 中没有。这是一个错误,还是参数改变了?有解决方案吗?
这是 2.0rc2 版本中的一个错误。现在可以通过在列配置中包含 flex: null 来解决网格的错误操作:
xtype: 'rallygrid',
columnCfgs: [
{dataIndex: 'ValueScore', width: 40, text:'Value', flex: null}
]
已经提交了一个缺陷,应该在下一个版本中修复。
看起来该错误不会影响基于自定义商店的网格。这是一个带有 Rally.data.custom.Store 的 rc2 应用程序(您可以在此处查看完整代码),其中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,如下所示: