Hi Stephen,
The 'Workspace' model is limited to fetching one workspace. You can either specify one or otherwise it will default to the defaultWorkspace of the user who owns the api-key you're using.
To get a list of your Subscription's workspaces, you shall use the Subscription model, then fetch and use the 'workspaces' collection.
Here is a sample code that works. You can see it's fetching the 'workspaces' collection. You can see it then iterates over the 'records' and writes to the console the Name and State of each workspace. For some reason I'm still struggling with displaying it on the grid, but I don't want to to delay my reply to you cause it's irrelevant to your challenge. The data that's returned by this sample below is working and correct. I'm bolding the elements the demonstrate what I just explained:
Ext.create('Rally.data.wsapi.Store', {
model: 'Subscription',
fetch: ['Name', 'Workspaces'],
autoLoad: true,
listeners: {
load: function(store, records) {
var subscription = records[0];
console.log('subscription.Name = ' + subscription.get('Name'));
var WorkspacesCollection = subscription.get('Workspaces');
var WorkspaceCount = WorkspacesCollection.Count;
console.log('WorkspaceCount = ' + WorkspaceCount);
subscription.getCollection('Workspaces').load({
fetch: ['Name', 'State'],
callback: function(records, operation, success) {
Ext.Array.each(records, function(workspace) {
console.log(workspace.get('Name') + ': ' + workspace.get('State'));
});
app._loadGrid(records);
}
});
}
}
});
Let us know if that helped.
Sagi