如何在Rally中获取项目名称?
我正在使用一个网格应用程序,我所要做的就是在网格视图中包含一个'Project‘字段。但是,因为'Project‘实际上是一个对象,所以结果字段是’object Object‘。那么,如何获得字符串类型的名称呢?
下面是我的columnCfgs中处理创建字段的代码。
{ text: 'Project', dataIndex: this.getContext().getProject().get },
发布于 2015-06-24 06:55:28
尝试使用this.getContext().getProject()._refObjectName或this.getContext().getProject().Name
在某些情况下,在控制台中打印和浏览对象很有用,因为您可能需要像在this gist中那样遍历project.data._refObjectName,或者在您的情况下:
Ext.define('CustomApp', {
extend: 'Rally.app.App',
componentCls: 'app',
items:{ html:'<a href="https://help.rallydev.com/apps/2.0/doc/">App SDK 2.0 Docs</a>'},
launch: function() {
var currentProject = this.getContext().getProject();
console.log(currentProject);
this.add({
xtype:'container',
html: currentProject.Name
});
}
});

https://stackoverflow.com/questions/31011712
复制相似问题