I am using the 'chooser below' to get some values out of an Initiative (The chooser displays Features and Team Features too but I will select the Initiative)
FormattedID, Name, Owner and DisplayColor
Have been trying to add "Parent" to the Columns but cannot seem to do it
Code extract:
Ext.create('Rally.ui.dialog.ArtifactChooserDialog', {
artifactTypes: ['PortfolioItem'],
autoShow: true,
columns : ['FormattedID', 'Name', 'Owner' , 'DisplayColor' ],
width : 800,
I get the values using
Code Extract
listeners: {
artifactChosen: function(dialog, selectedRecord){
// this.down("#item-label2").setText(selectedRecord.get('FormattedID') + ' - ' + selectedRecord.get('Name'));
this.down("#item-label2").setText(selectedRecord.get('Name'));
projectFID=selectedRecord.get('FormattedID');
projectName=selectedRecord.get('Name');
projectOwner=selectedRecord.get('Owner')._ref;
artifactColor=selectedRecord.get('DisplayColor');
I noticed that I can only .get the field that I have listed in the "Columns" above
The "Owner" was a little tricky and after some time realized that I needed to use the "._ref"
I was hoping that I would need to do the same for FormattedID but it does not work
My end aim is to update the Parent Field of a Feature with the reference of the chosen Initiative using code below
Code Extract:
rec.set("Project",app.projectRef);
rec.set("Name", projectName + newName);
rec.set("Owner",projectOwner);
rec.set("DisplayColor",artifactColor);
//If the itemType is set to I, then this first item must be Feature so add the INIT FID as the parent
if (itemType=="I") {
rec.set("Parent",projectFID._ref);
}
I know the "Parent" Field is an object and as such will not accept just text
I have had a look for properties for Parent and FormattedID to get an idea of how to do this but to no avail
Basically, what I am trying to do is
- Select an Initiative
- Update the next Feature's Parent field with the reference of the first Initiative
Of course, I could be way off target
All suggestions welcome
Thank You
Chas