Reputation: 201
How do you get the project name in Rally?
I'm working with a grid app and all I'm trying to do is include a 'Project' field for the grid view. However, because 'Project' is actually an object, the resulting field is '[object Object]'. So, how is it possible to get the name in string type?
Here's the code from my columnCfgs that deals with making the field.
{
text: 'Project',
dataIndex: this.getContext().getProject().get
},
Upvotes: 1
Views: 385
Reputation: 5966
Try this.getContext().getProject()._refObjectName
or this.getContext().getProject().Name
In some cases it is useful to print and explore the object in the console, because it may be that you need to traverse project.data._refObjectName
as in this gist, or in your case:
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
});
}
});
Upvotes: 1