You need to sign in to do that
Don't have an account?

how do I create Tab in accordian
I want to create Tab between accordian.
i want to do... when i click on that tab it shows contacts details
basically i am fatching account name and contacts and oppoertunity associted with the account.
>Account name
Tab1 Tab2
> contacts details if Tab1 selected
> oppoertunity deatils if Tab2 selected
<lightning:accordion>
<aura:iteration items="{!v.accList}"
var="acc">
<lightning:accordionSection name="{!acc.Name}"
label="{!acc.Name}">
<lightning:accordion>
<aura:iteration items="{!acc.Contacts}"
var="con">
<lightning:accordionSection name="{!con.Name}"
label="{!con.Name}">
<aura:set attribute="body">
<p>FirstName : {!con.FirstName}</p>
<p>LastName : {!con.LastName}</p>
<p>Phone: {!con.Phone}</p>
</aura:set>
</lightning:accordionSection>
</aura:iteration>
</lightning:accordion>
<lightning:accordion>
<aura:iteration items="{!acc.Opportunities}"
var="opp">
<lightning:accordionSection name="{!opp.Name}"
label="{!opp.Name}">
<aura:set attribute="body">
<p>Id : {!opp.Id}</p>
</aura:set>
</lightning:accordionSection>
</aura:iteration>
</lightning:accordion>
</lightning:accordionSection>
</aura:iteration>
</lightning:accordion>
this is working but only need to show details when tab selected
i want to do... when i click on that tab it shows contacts details
basically i am fatching account name and contacts and oppoertunity associted with the account.
>Account name
Tab1 Tab2
> contacts details if Tab1 selected
> oppoertunity deatils if Tab2 selected
<lightning:accordion>
<aura:iteration items="{!v.accList}"
var="acc">
<lightning:accordionSection name="{!acc.Name}"
label="{!acc.Name}">
<lightning:accordion>
<aura:iteration items="{!acc.Contacts}"
var="con">
<lightning:accordionSection name="{!con.Name}"
label="{!con.Name}">
<aura:set attribute="body">
<p>FirstName : {!con.FirstName}</p>
<p>LastName : {!con.LastName}</p>
<p>Phone: {!con.Phone}</p>
</aura:set>
</lightning:accordionSection>
</aura:iteration>
</lightning:accordion>
<lightning:accordion>
<aura:iteration items="{!acc.Opportunities}"
var="opp">
<lightning:accordionSection name="{!opp.Name}"
label="{!opp.Name}">
<aura:set attribute="body">
<p>Id : {!opp.Id}</p>
</aura:set>
</lightning:accordionSection>
</aura:iteration>
</lightning:accordion>
</lightning:accordionSection>
</aura:iteration>
</lightning:accordion>
this is working but only need to show details when tab selected
Try The Below Code Please Mark It As Best Answer If it Helps So It Can Help Others In Future.And It Motivates us To Give More In Community
Thank You!
All Answers
Try The Below Code Please Mark It As Best Answer If it Helps So It Can Help Others In Future.And It Motivates us To Give More In Community
Thank You!
this work perfectly.