Guest User

Untitled

a guest
Nov 20th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. @AuraEnabled
  2. public static Map<String, List<sObject>> returnSObjectMap() {...}
  3.  
  4. getsobjectMap : function(component) {
  5. var action = component.get("c.returnSObjectMap");
  6. action.setCallback(this, function(a) {
  7. if (a.getState() === "SUCCESS") {
  8. var sobjectFields = a.getReturnValue();
  9. var sobjectFieldsFinal = [];
  10. for (var key in sobjectFields) {
  11. sobjectFieldsFinal.push({value:sobjectFields[key], key:key});
  12. }
  13. component.set('v.sobjectsMap',sobjectFieldsFinal);
  14. } else if (a.getState() === "ERROR") {
  15.  
  16. }
  17. });
  18.  
  19. $A.enqueueAction(action);}
  20.  
  21. ...
  22. <aura:attribute name="sobjectsMap" type="List"/>
  23. ...
  24. <aura:iteration items="{! v.sobjectsMap }" var="sobjectList" indexVar="key">
  25. <apex:iteration items="{! sobjectList }" var="sobject">
  26. ...
  27. </apex:iteration>
  28. </aura:iteration>
  29.  
  30. <apex:iteration items="{! sobjectList }" var="sobject">
Add Comment
Please, Sign In to add comment