2

I currently have a Lightning app that displays a list of custom Master object records. They are displayed like so

<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes" controller="ListWhiteboardItemsApexController">

<aura:attribute name="whiteboardItems" type="Whiteboard_Item__c[]"/>

<aura:handler name="init" value="{!this}" action="{!c.doInit}" />

<aura:iteration items="{!v.whiteboardItems}" var="whiteboardItem">  
        <c:whiteboardItem whiteboardItem="{!whiteboardItem}" "/>
</aura:iteration>

Each of Master records can have many details records attached to it. I want to displayed all the detail records associated with each Master record. How do I do that?

1

You can use a wrapper class accordingly to store the related records of each master records and display in the component.

0

You will need to handle that in the server-controller and parse the response for that server call... something like:

var action = component.get("c.getWhiteboardItems");
action.setParams({whiteBoardId : id});
action.setCallback(this, function(response){
    var state = response.getState();
        if (state === "SUCCESS") {
           component.set("v.whiteboardItems", response.getReturnValue());
        }
});
$A.enqueueAction(action);
0

Related list is not supported in Lightning Components, you might need to create separate tabs within your component.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.