I am working on a set of Lightning Components - all in the same namespace - that allow rows to be interactively added to a page and cells within the rows to be selected from database values and that works fine. When all the work is done, logic in the root table component can walk down through all the rows and cells and save the result to the database.
But I now have a case where one of my components within a row needs to find out about the content from other rows. So, using HTML terminology, a
td component needs to grab information from multiple other
td components located in many
tr components in the overall
There is this post How to get parent lightning component's attribute in child component?. It says that getting hold of your parent component breaks encapsulation but suggests a work around of passing references to the parent component data to the child component - not sure why the "breaks encapsulation" argument doesn't apply for that case. Or it suggests using events to communicate.
Are there any alternatives that make sharing model data between a set of co-operating (not stand-alone) components convenient?
td component can walk up and down the tree as it needs. Anyone used this approach?
I've just placed an order for Force.com Enterprise Architecture Second Edition that has a section "Lightning Architecture and Components" that may help.