You need to sign in to do that
Don't have an account?
Amidou Cisse
Hello everyone, I hope you are well.
I have this array of data to develop by lightning component, this table allows me to show some data from my campaign as you can see below. If someone has already developed a simulare lightning component, I would like to have their code as a model to adapt my table.
Thank you in advance.
Need a Lightning component to display a data-table of my campaign data. Please help !
Hello everyone, I hope you are well.
I have this array of data to develop by lightning component, this table allows me to show some data from my campaign as you can see below. If someone has already developed a simulare lightning component, I would like to have their code as a model to adapt my table.
Thank you in advance.
All Answers
You can use Lightning: datatable base component.
Refer below links.
http://sfdcmonkey.com/2018/01/05/lightning-datatable-base-component/
http://sfdcmonkey.com/2018/01/05/lightning-datatable-base-component/
Best Regards,
Sandhya
<aura:component controller="campaignApexController" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId" access="global" >
<aura:attribute name="record" type="Object" description="The record object to be displayed"/>
<aura:attribute name="CampaignRecord" type="Object" description="A simplified view record object to be displayed"/>
<aura:attribute name="recordError" type="String" description="An error message bound to force:recordData"/>
<force:recordData aura:id="record"
recordId="{!v.recordId}"
targetFields="{!v.CampaignRecord}"
targetError="{!v.recordError}"
targetRecord="{!v.record}"
mode="VIEW"
/>
<!-- Display a lightning card with details about the record -->
<div class="Record Details">
<lightning:card iconName="standard:account" title="{!v.CampaignRecord.Name}" >
<div style="overflow-x:auto;" class="container theTable">
<h1 style="font-weight: bold; color:white"> Details Campaign </h1>
<table class="slds-table slds-table_bordered slds-table_cell-buffer">
<tr>
<td data-label="Category">
<div class="slds-truncate" title="Category"> Category </div>
</td>
<td >
<div class="slds-truncate">
<lightning:formattedText title="Category" value="{!v.CampaignRecord.Celine_Category__c}" />
</div>
</td>
<td data-label="Invited">
<div class="slds-truncate" title="Invited"> Invited </div>
</td>
<td data-label="Invited">
<div class="slds-truncate">
<lightning:formattedText value="{!v.CampaignRecord.Celine_TotalInvited__c}" />
</div>
</td>
<td data-label="emp">
<div class="slds-truncate" title="emp"></div>
</td>
<td data-label="tot_pot_sales">
<div class="slds-truncate" > Total Direct Sales </div>
</td>
<td data-label="tot_pot_sales_amount">
<div class="slds-truncate" >
<lightning:outputField value="{!v.CampaignRecord.Celine_TotalDirectSales__c}" />
</div>
</td>
<td data-label="emp">
<div class="slds-truncate" title="emp"></div>
</td>
<td data-label="Clienteling_rate">
<div class="slds-truncate" title="Clienteling_rate">Total Units</div>
</td>
<td data-label="Clienteling_rate_val">
<div class="slds-truncate">
<lightning:outputField value="{!v.CampaignRecord.Celine_Total__c}" />
</div>
</td>
<td data-label="emp">
<div class="slds-truncate" title="emp"></div>
</td>
</tr>
<tr>
<td data-label="Category">
<div class="slds-truncate" title="Category"> Category </div>
</td>
<td data-label="Preview">
<div class="slds-truncate"> <ui:outputText value="{!v.CampaignRecord.Celine_Category__c}"/> </div>
</td>
<td data-label="Invited">
<div class="slds-truncate" title="Invited"> Invited </div>
</td>
<td data-label="Invited">
<div class="slds-truncate"> <ui:outputNumber value="{!v.CampaignRecord.Celine_TotalInvited__c}"/> </div>
</td>
<td data-label="emp">
<div class="slds-truncate" title="emp"></div>
</td>
<td data-label="tot_pot_sales">
<div class="slds-truncate" > Total Direct Sales </div>
</td>
<td data-label="tot_pot_sales_amount">
<div class="slds-truncate" > <ui:outputNumber value="{!v.CampaignRecord.Celine_TotalDirectSales__c}"/></div>
</td>
<td data-label="emp">
<div class="slds-truncate" title="emp"></div>
</td>
<td data-label="Clienteling_rate">
<div class="slds-truncate" title="Clienteling_rate">Total Units</div>
</td>
<td data-label="Clienteling_rate_val">
<div class="slds-truncate"> <ui:outputNumber value="{!v.CampaignRecord.Celine_Total__c}"/> </div>
</td>
<td data-label="emp">
<div class="slds-truncate" title="emp"></div>
</td>
</tr>
<tr>
<td data-label="Category">
<div class="slds-truncate" title="Category"> Category </div>
</td>
<td data-label="Preview">
<div class="slds-truncate"> <ui:outputText value="{!v.CampaignRecord.Celine_Category__c}"/> </div>
</td>
<td data-label="Invited">
<div class="slds-truncate" title="Invited"> Invited </div>
</td>
<td data-label="Invited">
<div class="slds-truncate"> <ui:outputNumber value="{!v.CampaignRecord.Celine_TotalInvited__c}"/> </div>
</td>
<td data-label="emp">
<div class="slds-truncate" title="emp"></div>
</td>
<td data-label="tot_pot_sales">
<div class="slds-truncate" > Total Direct Sales </div>
</td>
<td data-label="tot_pot_sales_amount">
<div class="slds-truncate" > <ui:outputNumber value="{!v.CampaignRecord.Celine_TotalDirectSales__c}"/></div>
</td>
<td data-label="emp">
<div class="slds-truncate" title="emp"></div>
</td>
<td data-label="Clienteling_rate">
<div class="slds-truncate" title="Clienteling_rate">Total Units</div>
</td>
<td data-label="Clienteling_rate_val">
<div class="slds-truncate"> <ui:outputNumber value="{!v.CampaignRecord.Celine_Total__c}"/> </div>
</td>
<td data-label="emp">
<div class="slds-truncate" title="emp"></div>
</td>
</tr>
</table>
</div>
<!-- </aura:iteration> -->
</lightning:card>
</div>
<!-- Display Lightning Data Service errors, if any -->
<aura:if isTrue="{!not(empty(v.recordError))}">
<div class="recordError">
{!v.recordError}</div>
</aura:if>
</aura:component>
https://www.codekiat.com/2019/08/salesforce-lightning-datatable-example-with-lwc-lightning-web-component.html
--
Naveen K N