Picture of Matt Leathes
Re: Expanding menu
by Matt Leathes - Thursday, 1 March 2018, 11:43 AM
 

Hi Stu

Not sure how that's happening then because Adapt.contentObjects.models[0].getAncestorModels()[0].attributes._children._byId looks to me like it's just a much longer way of stating the same thing, equivalent to saying 'give me an ordered list of my eldest son's parents' children'...

Note that _byId is private property of Backbone so it's not really intended to be accessed directly like that. Adapt.contentObjects will give you a Backbone Collection that you can iterate through, equally Adapt.contentObjects._byAdaptID might be a better way.

It may be down to how the AT automatically generates and assigns IDs to contentObjects/articles/blocks/components - I do most of my work in the Framework so am used to being able to set these up for myself.