Advertisement
Guest User

Untitled

a guest
Sep 17th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. ({
  2. init : function(cmp, event, helper) {
  3. var action = cmp.get("c.initData");
  4. action.setCallback(this,function(response){
  5. var state = response.getState();
  6. if(state === 'SUCCESS') {
  7. var res = response.getReturnValue();
  8. console.log(JSON.stringify(res.fields));
  9. cmp.set('v.columns', res.fields);
  10. var fetchData = [{
  11. Id: "/0019000001j9i7b",
  12. Name: "Aethna Home Products"
  13. }];
  14. cmp.set("v.data",fetchData);
  15.  
  16. /*cmp.set('v.columns', [
  17. {"label": "Name", "fieldName": "Id", "type": "url", "typeAttributes": {"label": { "fieldName": "Name" }, "target": "_blank"}}
  18. ]);
  19. cmp.set('v.columns', [
  20. {"editable":true,"fieldName":"Id","type":"url","typeAttributes":"{label :{ fieldName : 'Name'}, target: '_blank'}"}
  21. ]);*/
  22. //id field is used for the url link
  23. //Name field is used as the url name
  24.  
  25. }
  26. });
  27. $A.enqueueAction(action);
  28.  
  29. }
  30. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement