Javascript 在Rally SDK中,显示UI组件中的隐藏字段
当某个字段在Rally中“隐藏”时,它们将不会显示在SDK的任何UI组件中。例如,我无法使用dataIndex为Javascript 在Rally SDK中,显示UI组件中的隐藏字段,javascript,rally,appsdk2,Javascript,Rally,Appsdk2,当某个字段在Rally中“隐藏”时,它们将不会显示在SDK的任何UI组件中。例如,我无法使用dataIndex为\u ref的列创建rallygrid,因为\u ref是一个隐藏字段。我也有隐藏的自定义字段,但我确实需要使用它们在rallygrid中创建列 我已经浏览了sdk源代码,知道这些都是从sdk的ui组件中删除的,所以我想我正在寻找一种解决方法,或者是一种破解方法来解决这个问题 我对这个问题发表了评论在基于。我修改了一个自定义数据网格,用每个记录的_ref值填充一个参考列: Ext.de
\u ref
的列创建rallygrid
,因为\u ref
是一个隐藏字段。我也有隐藏的自定义字段,但我确实需要使用它们在rallygrid
中创建列
我已经浏览了sdk源代码,知道这些都是从sdk的ui组件中删除的,所以我想我正在寻找一种解决方法,或者是一种破解方法来解决这个问题
我对这个问题发表了评论在基于。我修改了一个自定义数据网格,用每个记录的_ref值填充一个参考列:
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
}
]
})
}
});
Ext.define('CustomApp'{
扩展:“Rally.app.app”,
组件CLS:“应用程序”,
项目:{html:'},
启动:函数(){
Ext.create('Rally.data.wsapi.Store'{
模型:“用户故事”,
自动加载:对,
听众:{
加载:这个。加载后,
范围:本
},
获取:['FormattedID'、'Name'、'\u ref']
})
},
_onDataLoaded:函数(存储、数据){
var records=\映射(数据,函数(记录){
返回Ext.apply({
参考:记录。获取(“参考”)
},record.getData());
});
这个。添加({
xtype:“rallygrid”,
showPagingToolbar:false,
showRowActionsColumn:false,
可编辑:false,
store:Ext.create('Rally.data.custom.store'{
数据:记录
}),
专栏CFGS:[
{
xtype:'templatecolumn',
文本:“ID”,
dataIndex:'FormattedID',
宽度:100,
tpl:Ext.create('Rally.ui.renderer.template.FormattedIDTemplate')
},
{
文本:“名称”,
数据索引:“名称”
},
{
文本:“参考”,
数据索引:“Ref”,
弹性:1
}
]
})
}
});
此方法确实允许我显示自定义字段列,谢谢