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

lightning:tile in 2 columns
Hello Helpers
I am playign with component Lightning:tile and trying to display some records(retrieved from Opportunities and related Account) in tiles
I am able to do this but the tiles are in 1 column
I would like to have 2 columns
This is what I have now.

The information I want to display are stored in a 2 dimensional strign array (v.mydataLst in my code)
The columns are in a separate string array
I am using a couple of aura:iteration to fetch the array data items and the column headers but it does not looks as I would like to look
Any advice?
Thanks in advance
Csaba
<aura:iteration items="{!v.mydataLst}" var="records" >
<div id="Tilu" class="slds-size_1-of-2 slds-box">
<lightning:tile label="{!records[0]}">
<aura:set attribute="media">
<lightning:icon iconName="standard:groups"/>
</aura:set>
<aura:iteration items="{!v.mycolumnsLst}" var="col" indexVar="colCount">
<aura:if isTrue="{!(colCount > 0)}">
<aura:iteration items="{!records}" var="recItem" indexVar="rowcount">
<aura:if isTrue="{!(rowcount == colCount)}">
<dl class="slds-dl_horizontal" >
<dt class="slds-dl_horizontal__label">
<p class="slds-truncate" >{!col.label}:</p>
</dt>
<dd class="slds-dl_horizontal__detail slds-tile__meta">
<p class="slds-truncate" >{!recItem}</p>
</dd>
</dl>
</aura:if>
</aura:iteration>
</aura:if>
</aura:iteration>
</lightning:tile>
</div>
I am playign with component Lightning:tile and trying to display some records(retrieved from Opportunities and related Account) in tiles
I am able to do this but the tiles are in 1 column
I would like to have 2 columns
This is what I have now.
The information I want to display are stored in a 2 dimensional strign array (v.mydataLst in my code)
The columns are in a separate string array
I am using a couple of aura:iteration to fetch the array data items and the column headers but it does not looks as I would like to look
Any advice?
Thanks in advance
Csaba
<aura:iteration items="{!v.mydataLst}" var="records" >
<div id="Tilu" class="slds-size_1-of-2 slds-box">
<lightning:tile label="{!records[0]}">
<aura:set attribute="media">
<lightning:icon iconName="standard:groups"/>
</aura:set>
<aura:iteration items="{!v.mycolumnsLst}" var="col" indexVar="colCount">
<aura:if isTrue="{!(colCount > 0)}">
<aura:iteration items="{!records}" var="recItem" indexVar="rowcount">
<aura:if isTrue="{!(rowcount == colCount)}">
<dl class="slds-dl_horizontal" >
<dt class="slds-dl_horizontal__label">
<p class="slds-truncate" >{!col.label}:</p>
</dt>
<dd class="slds-dl_horizontal__detail slds-tile__meta">
<p class="slds-truncate" >{!recItem}</p>
</dd>
</dl>
</aura:if>
</aura:iteration>
</aura:if>
</aura:iteration>
</lightning:tile>
</div>
use lighting:layout and lightning:layoutItem tags for it, here is sample example :
apex : Lightning component :
js : output :
Kindly let us know if it helps you, & close this query by selecting best answer if you got your solution, so this will helps other in future
sfdcMonkey.com
All Answers
use lighting:layout and lightning:layoutItem tags for it, here is sample example :
apex : Lightning component :
js : output :
Kindly let us know if it helps you, & close this query by selecting best answer if you got your solution, so this will helps other in future
sfdcMonkey.com
Very useful help from you again
I will close the ticket