You need to sign in to do that
Don't have an account?
Maria Alexandra Andrica
data row index in iteration
I'm trying to find out the row number for which the toggle was clicked but everything I did it is not working.
<aura:iteration items="{!v.newWFs}" var="header" indexVar="rowIndex"> <tr aria-selected="false" class="slds-hint-parent" id="{!rowIndex}"> <td aura:id="submit" label="{!rowIndex}" data-value="{!rowIndex}" data-row-index="{!rowIndex}" onclick="{!c.toggle}"> <span class="slds-assistive-text">Details </span> </button> --> <div data-drag-id="{!rowIndex}"> <aura:if isTrue="{!v.NewWFFilters}"> <h1> <lightning:icon id="{!rowIndex}" data-selected-Index="{!rowIndex}" iconName="utility:chevrondown" alternativeText="Workflows" size="x-small"/> </h1> </aura:if> <aura:if isTrue="{!not(v.NewWFFilters)}"> <h1> <lightning:icon id="{!rowIndex}" data-selected-Index="{!rowIndex}" iconName="utility:chevronright" alternativeText="Workflows" size="x-small"/> </h1> </aura:if> </div> </td> toggle : function(component, event, helper) { var rows = component.get("v.newWFs"); rows[event.target.dataset.index].expanded = !rows[event.target.dataset.index].expanded; component.set("v.newWFs", rows); component.set("v.NewWFFilters", !component.get("v.NewWFFilters")); },
itzmukeshy7
Why you don't wana use the lightning:accordion (https://developer.salesforce.com/docs/component-library/bundle/lightning:accordion/example) standard component?
Maria Alexandra Andrica
How can I use it with table?
itzmukeshy7
I can help you if you share some UI, what you are trying to develop.