You need to sign in to do that
Don't have an account?
Brooks Johnson 6
Component failed to display
I am trying to build my first Lightning Component for my production Org by following along with Trailhead and modifying my code to fit the data I need from my sandbox. My component will not display and I swear I have been over my code 100 times. Any help would be great.
Lightning Component
Controller
JS Controller
Lightning Component
<aura:component implements="flexipage:availableForAllPageTypes" access="global" controller="DivisionHealthCheckController" > <aura:attribute name="Divisions" type="Division__c"/> <aura:handler name="init" action="{!c.doInit}" value="{!this}"/> <lightning:card title="Division Health Checks"> <aura:set attribute="body"> <table class="slds-table slds-table_bordered slds-table_cell-buffer"> <thead> <tr class="slds-text-title_caps"> <th scope="col">Division</th> <th scope="col">Grade</th> <th scope="col">Total Influencers</th> </tr> </thead> <tbody> <aura:iteration items="{!v.Divisions}" var ="div"> <tr scope="row"> <td> {!div.Name}</td> <td> {!div.Grade__c}</td> </tr> </aura:iteration> </tbody> </table> </aura:set> </lightning:card> </aura:component>
Controller
public with sharing class DivisionHealthCheckController { @AuraEnabled public static List<Division__c> divisionHealth(){ return [SELECT Id, Name, Grade__c FROM Division__c ]; } }
JS Controller
({ doInit : function(component, event, helper) { var action = component.get("c.divisionHealth"); action.setCallback(this, function(data){ component.set("v.Divisions", data.getReturnValue()); console.log(data.getReturnValue()); }); $A.enqueueAction(action); } })
Hi,
i tried to recreate the scenario with another object.
I used Account in place of your object, and was able to view the component with details.
kindly check the FLS and CRUD for the same object and fields,
Regards.