function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Jay WeerappuligeJay Weerappulige 

Lightning component removing multiple values from data columns

I have a customer community component built with data fething from a child custom object with data from parent object as well. I want to display only none value from parent object for multiple rows from child object. I want to hide value 'A' from 2nd and 3rd rows
Column 1 Column 2
A              X
A              Y
A              Z

Can anyone helpme.
Thanks in advance
NagendraNagendra (Salesforce Developers) 
Hi Jay,

You can use aura: if to do a conditional rendering ,however please post your code example so that we can take a look.

Regards,
Nagendra.P
Jay WeerappuligeJay Weerappulige
Thanks and component and Apex controller is below
COMPONENT
<aura:component controller="MyActiveModuleAuraController" access="global" 
                implements="flexipage:availableForAllPageTypes,forceCommunity:availableForAllPageTypes,force:appHostable">
    
  <aura:handler name="init" action="{!c.doInit}" value="{!this}" />
  <aura:attribute name="moduleRows" type="Assessment_Module__c[]" /> 
    
      <ltng:require styles="/resource/SLDS102/assets/styles/salesforce-lightning-design-system-ltng.css" 
                  scripts="/resource/Jquery" />
   
    
    <div class="slds">  
        <p>
            <b> My Active Training Modules</b>
        </p>
        <br>
        </br>
        <table class="slds-table slds-table--bordered slds-max-medium-table--stacked">
          <thead>
               <tr class ="slds-text-heading--label"> 
                    <td class = "boldHeader slds-cell-wrap slds-size--1-of-4">Module Name</td>
                    <td class = "boldHeader slds-cell-wrap slds-size--1-of-4">Resourse Issued</td>
                    <td class = "boldHeader slds-cell-wrap slds-size--1-of-4">Assessor</td>
                    <td class = "boldHeader slds-cell-wrap slds-size--1-of-4">Standard Name</td>
               </tr>
            </thead>
            <tbody>
                <aura:iteration var="cell" items="{!v.moduleRows}">
                    <tr>
                        <td data-label="Module Name"> {!cell.Module__c} </td>
                        <td data-label="Resource Issued">
                            <ui:outputDate value="{!cell.Resource_Issued__c}" /> </td>
                        <td data-label="Assessor"> {!cell.Assessor__c} </td>
                        <td data-label="Standard Name"> {!cell.Standard_Name__c} </td>
                    </tr>
                </aura:iteration>
            </tbody>
        </table>
    </div>
</aura:component>

CONTROLLER
({
    doInit: function(component, event, helper) {      
         helper.myModules(component);
    
    }
})

HELPER
({
   myModules: function(component, event, helper) {
    var action = component.get("c.getMyActiveModules");
      action.setCallback(this, function(a){
          component.set("v.moduleRows", a.getReturnValue());
      });
    $A.enqueueAction(action);
  }   
})

APEX CONTROLLER
public class MyActiveModuleAuraController {
    @AuraEnabled
    public static List<Assessment_Module__c> getMyActiveModules(){
        //Get logged in user details
        User loggedInUser = [SELECT Id, ContactId
                             FROM User
                             WHERE ID=: UserInfo.getUserId() LIMIT 1];
        System.debug('=loggedInUser===='+loggedInUser);
        
        return [select Assessor__c, Resource_Issued__c, Module__c, Standard_Name__c, Module_Completed_date__c 
                FROM Assessment_Module__c WHERE  Completed__c = False AND TP_Status__c    ='Active'
              //  AND First_Name__c ='Trainee'
              AND Trainee__c =:loggedInUser.ContactId];
}
}