OK, so I delved into the code for the grid. Only to find that it has a load of stuff to try and prevent you doing anything with fields that are hidden. You can trawl through and create overrides, but it might take you a while.
Here is the code snippet I used to override the hiding of the column, but that was just the beginning......
Ext.define('Rally.ui.grid.ColumnBuilderFix', {
extend: 'Rally.ui.grid.ColumnBuilder',
statics: {
ICON_FIELDS: ['Defects', 'Dicsussion', 'DisplayColor', 'Milestones', 'PredecessorsAndSuccessors', 'Tags', 'Tasks', 'TestCases'],
ICON_HEADER_FIELDS: { PredecessorsAndSuccessors: 'predecessor' },
},
_removeHiddenColumns: function (arg) {
return arg;
},
});
Ext.define('CustomApp', {
extend: 'Rally.app.App',
componentCls: 'app',
fieldList: [
'FormattedID',
'Name',
'c_RequiredBy'
],
launch: function () {
var me = this;
var store = Ext.create('Rally.data.wsapi.Store', {
model: 'User Story',
autoLoad: true,
fetch: me.fieldList,
listeners: {
load: function (store, records, success) {
me.addGrid(store);
},
scope: me
}
});
},
addGrid: function (store) {
var me = this;
var context = this.getContext();
var modelName = 'defect';
this.add({
xtype: 'rallygrid',
context: context,
model: modelName,
stateful: false,
storeConfig: {
store: store,
remoteFilter: false,
},
buildColumns: function (models) {
return Ext.create('Rally.ui.grid.ColumnBuilderFix').
withContext(this.getContext()).
withEditingEnabled(this.enableEditing).
withRankingEnabled(this.enableRanking).
withDefaultColumns(this.columnCfgs).
withSortableColumns(this.sortableColumns).
shouldAutoAddAllModelFieldsAsColumns(this.autoAddAllModelFieldsAsColumns).
shouldShowRowActionsColumn((this.showRowActionsColumn && this.rowActionColumnConfig) || this.showRowActionsColumn).
withDisableColumnMenus(this.disableColumnMenus).
withEditorsDisabledForColumns(this._getDisabledEditorColumns(models)).
build(models);
},
columnCfgs: me.fieldList
});
}
});
------------------------------
Nik
Rally Sales Engineer
Rally Software
------------------------------
Original Message:
Sent: 12-09-2019 11:32 AM
From: Zachary Lee
Subject: Modify Hidden Fields in Custom App
This is what I found:
Original Message:
Sent: 12-09-2019 11:20 AM
From: Nik Antonelli
Subject: Modify Hidden Fields in Custom App
Hi Zach, what does the WSAPI doc show you for that custom field?
https://rally1.rallydev.com/slm/doc/webservice/
E.g.
------------------------------
Nik
Rally Sales Engineer
Rally Software
Original Message:
Sent: 12-09-2019 10:50 AM
From: Zachary Lee
Subject: Modify Hidden Fields in Custom App
Hi Nik,
Thanks for getting back to me. Im not actually seeing the ''true field" field which is the problem and maybe the code below will help show that. I also probably need to explain my use case a little better.
Use Case:
I created a hidden field for defects which doesn't show up in the defect window when you look at a defect. So far this behavior is correct. The idea being this field is only visible and editable from the app that I am creating. The reason for this is because it allows our teams to perform reviews and note lessons learned that can be brought up during a review.
Problem:
The problem I face is since it is a hidden field the rally grid seems to ignore it when I add it to the columnCfgs I have to do it manually and because I did it this way you can't edit or add data.
{ xtype: 'rallygrid', showPagingToolbar: true, showRowActionsColumn: false, enableEditing: true, itemId: "defectView", height: 300, width: 1000, storeConfig: { model: 'defect', filters: newFilters, }, columnCfgs: [ { text: "ID", dataIndex: 'FormattedID', flex: 1 }, { text: "Name", dataIndex: 'Name', flex: 1 }, { text: "Defect Type", dataIndex: 'c_DefectType', flex:1 }, { text: "Lessons Learned", renderer: function(value,meta,record) { return record.get('c_LessonsLearned'); }, }, ]};
Hope this helped
Thanks,
~Zach
Original Message:
Sent: 12-09-2019 09:56 AM
From: Nik Antonelli
Subject: Modify Hidden Fields in Custom App
Hi Zach, if the field is hidden and you can still see it, that would suggest that you have admin rights. However, it sounds like the issue is in your app that you are running from your admin login.
I might need to see some of your code to fully understand what is going on, but my first guess would be that you have fetched data (e.g. UserStories) and put them into either a custom store or an artifact store. I have noticed that when you do this, the records are marked with { updatable: false }. This would prevent you from modifying the field. If this is what you are doing, can you try putting the data into a Rally.data.wsapi.Store and give it the model type of the records you are fetching and see what it does then?
------------------------------
Nik
Rally Sales Engineer
Rally Software
Original Message:
Sent: 12-05-2019 12:59 PM
From: Zachary Lee
Subject: Modify Hidden Fields in Custom App
Hi,
I'm trying to show and modify a field this field is a hidden meaning it is not visible to any projects. This is because I don't want this field to show in the defect view window, only show in the app that I'm developing. I am able to render the field to the UI using 'renderer' and returning the record.get('c_fieldName') this is contained in a 'rallygrid' . Although I noticed I am not able to edit the field and therefore won't be able to keep track of data entered in this field. Is there a way to allow this field to be modified and retain its data?
Thanks,
~Zach