SDK2:Rally 网格和列宽中的链接 [英] SDK2: Links in Rally Grids and column width
本文介绍了SDK2:Rally 网格和列宽中的链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在以简单的方式在 Rally Grid 中显示一个缺陷的链接:
I'm displaying a link to a defect in a Rally Grid in the simple way:
columnCfgs: ['FormattedID', 'Name', ...]
这会创建一个指向缺陷的链接,就像它应该的那样.但是列宽太大了.但是,如果我执行以下操作,则会丢失链接:
This creates a link to the defect, just like it should. But the column width is way too big. But if I do the following, I loose the link:
columnCfgs: [{dataIndex: 'FormattedID', width: 50, text:'ID'}', 'Name', ...]
是否有一个方便的 xtype 可以用来调整宽度,但仍然有指向我的缺陷的链接?
Is there a convenient xtype I can use to adjust the width, but still have a link to my defect?
推荐答案
不幸的是,目前没有一种简单的方法可以做到这一点.我们将在 GA SDK 2.0 之前解决这个问题.现在这里有一个解决方法:
Unfortunately there is not an easy way to do this right now. We are going to fix this before we GA the SDK 2.0. For now here is a workaround:
Ext.define('DefectGridApp', {
extend: 'Rally.app.App',
launch: function() {
Rally.data.ModelFactory.getModel({
type: 'Defect',
success: function(model) {
//Get the default field config
var field = model.getField('FormattedID');
var fieldConfig = Rally.ui.grid.FieldColumnFactory.getColumnConfigFromField(field);
//Override with your values
fieldConfig.width = 10;
this.grid = this.add({
xtype: 'rallygrid',
model: model,
columnCfgs: [
fieldConfig, //pass your overridden formatted id field here
'Name',
'Owner'
]
});
},
scope: this
});
}
});
这篇关于SDK2:Rally 网格和列宽中的链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文