gpt4 book ai didi

javascript - 在 Rally SDK 中,显示 UI 组件中的隐藏字段

转载 作者:行者123 更新时间:2023-11-28 01:07:53 24 4
gpt4 key购买 nike

当某个字段在 Rally 中“隐藏”时,它们将不会显示在任何 SDK 的 UI 组件中。例如,我无法使用 dataIndex 为 _ref 的列创建 rallygrid,因为 _ref 是隐藏字段。我还有隐藏的自定义字段,但我确实需要使用它们在 rallygrid 中创建列。

我查看了 sdk 源代码,知道这些已从 SDK 的 ui 组件中删除,因此我想我正在寻找解决方法或破解方法来解决此问题。

我评论了这个问题here

最佳答案

可以在基于 custom store 的网格中包含 _ref 。我修改了自定义数据网格example使用每条记录的 _ref 值填充引用列:

enter image description here

Ext.define('CustomApp', {
extend: 'Rally.app.App',
componentCls: 'app',
items:{ html:'<a href="https://help.rallydev.com/apps/2.0rc3/doc/">App SDK 2.0rc3 Docs</a>'},
launch: function() {
Ext.create('Rally.data.wsapi.Store', {
model: 'userstory',
autoLoad: true,
listeners:{
load: this._onDataLoaded,
scope: this
},
fetch: ['FormattedID', 'Name', '_ref']
})
},
_onDataLoaded: function(store,data){
var records = _.map(data, function(record){
return Ext.apply({
Ref: record.get('_ref')
}, record.getData());
});
this.add({
xtype: 'rallygrid',
showPagingToolbar: false,
showRowActionsColumn: false,
editable: false,
store: Ext.create('Rally.data.custom.Store', {
data: records
}),
columnCfgs:[
{
xtype: 'templatecolumn',
text: 'ID',
dataIndex: 'FormattedID',
width: 100,
tpl: Ext.create('Rally.ui.renderer.template.FormattedIDTemplate')
},
{
text: 'Name',
dataIndex: 'Name'
},
{
text: 'Reference',
dataIndex: 'Ref',
flex: 1
}
]
})
}
});

关于javascript - 在 Rally SDK 中,显示 UI 组件中的隐藏字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24847232/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com