public with sharing class EmployeeAvailability {
public static empAvailableInnerclass innerCList;
public class empAvailableInnerClass {
@AuraEnabled public Decimal aetPerc {get;set;} @AuraEnabled public Integer totalEmployeesToday {get;set;} @AuraEnabled public Decimal budgetThisMonth {get;set;} @AuraEnabled public Decimal averageMargin {get;set;} @AuraEnabled public Object averageRate {get;set;} @AuraEnabled public Integer illnessToday {get;set;} @AuraEnabled public List<availableNextSixty> AvailableSixty{get;set;} @AuraEnabled public Date DateAfterTwoMonths {get;set;} public empAvailableInnerclass() { DateAfterTwoMonths=Date.today().addmonths(2);}
}
@AuraEnabled public static empAvailableInnerclass getEmployeesDailyStatus(){ runRetrieve(); return innerCList;}
}
JavaScript controller:getFixedTable : function(cmp, event, helper) { //debugger; var table = cmp.get("c.getEmployeesDailyStatus"); table.setCallback(this,function(response){ var state = response.getState(); if (state === "SUCCESS") { cmp.set("v.tabTable",response.getReturnValue()); } else if (state === "ERROR") { alert('Error : ' + JSON.stringify(errors)); } }); $A.enqueueAction(table); }Lightning Component:<aura:handler name="init" value="{!this}" action="{!c.getFixedTable}"/><aura:attribute name="tabTable" type="EmployeeAvailabilityLightning"/><table id="fixedTab"> <thead> <tr> <th>Total employees today : {!v.tabTable.totalEmployeesToday}</th> <th>Budget this month : {!v.tabTable.budgetThisMonth}</th> <th>Average Margin : {!v.tabTable.averageMargin} %</th> <th>Available next 60 days : {!v.tabTable.AvailableSixty.size}</th> <th>Employee hours available today : {!v.tabTable.aetPerc} %</th> <th>Illness Today: {!v.tabTable.illnessToday}</th> </tr> </thead> </table>8 answers