My requirement is to show all the cases related to parent object 'MTO' on case except the one case which is open .Ex there are 5 cases on MTO if I open 1 case then I should see other 4 cases on case related list. I have created lightning component .But the look and feel is not like related list .
Currently my lightning component is looking like this .
also the view all button is not clickable .How can I show sandard view all button functionality?
But I want it to be look like this
This is my lightning component design
Related case
Related case
Case Number
</table>
<!-- <div class="slds-box slds-box_xx-small" style="padding:1Rem;">-->
<aura:iteration items="{!v.CaseRelatedList}" var="case">
<tr>
<a href="{!'https://.force.com/lightning/r/Case/'+ case.Id + '/view?0.source=alohaHeader'}" target="_blank">{!case.CaseNumber}
</a>
</tr>
</aura:iteration>
<!--</div>-->
</div>
<div class="slds-box slds-box_xx-small">
View All
Related case
Best Answer
There are actually a lot of ways how to achieve what you want but I'll point you to one that is I think easiest to do.
You can use
lightning:datatable
base component.So basically copy pasting example from documentation:
Component
Controller
Helper
Apex method
That way you will receive Cases that you want in datatable form. Please be advised that fieldNames in columns must match cases fields. If you want to use other names you need to create wrapper for it.
About view all button. You can for example on button click fetch all of the cases and not only 10. Or navigate to a specific list view using lightning:navigation and page reference. There is also many ways and you didnt specify what you want to do.
References: https://developer.salesforce.com/docs/component-library/bundle/lightning:datatable/example https://developer.salesforce.com/docs/component-library/bundle/lightning:navigation/documentation