AnsweredAssumed Answered

Array has no elements, but has elements? (7.5)

Question asked by on Jul 16, 2015
Latest reply on Jul 16, 2015 by
I would like to get the documents from the contacts of a case in js:
var parentModel=this.context.get('parentModel');

var linkName = 'contacts';
var subpanelCollection = parentModel.getRelatedCollection(linkName);
subpanelCollection.fetch({relate: true});
var linkName = 'documents';
var subpanelCollection = subpanelCollection['models'][0].getRelatedCollection(linkName);
subpanelCollection.fetch({relate: true});

The resultat in the console is this:

In the console I can see the documents, but in the code the array is always empty.

How could I get the document ids?