Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. initTable: function (component, event, helper) {
  2. console.log("Enter initTable");
  3.  
  4. var fieldList = component.get("v.rawFields");
  5. console.log(fieldList);
  6. var colList = [];
  7. for(var i = 0; i < fieldList.length; i++){
  8.  
  9. console.log('fieldType ==> ' + fieldList[i].Field_Type__c);
  10. if(fieldList[i].Field_Type__c == 'detailLink'){
  11. var colMap = {
  12. label: fieldList[i].MasterLabel,
  13. fieldName: fieldList[i].Id,
  14. type: 'button',
  15. cellAttributes: { alignment: 'left' },
  16. typeAttributes: {
  17. iconName: 'description',
  18. name: 'viewDetails',
  19. title: 'Click to view details',
  20. label: {
  21. fieldName: fieldList[i].Id
  22. },
  23. disabled: false,
  24. value: 'test',
  25. variant: 'base'
  26. }
  27. }
  28. }
  29. else if (fieldList[i].Field_Type__c == 'Checkbox') {
  30. var colMap = {
  31. label: fieldList[i].MasterLabel,
  32. fieldName: 'm01m0000000CwMYAA0',// fieldList[i].Id,
  33. type: 'boolean'//this.getType(fieldList[i].Field_Type__c),
  34. };
  35. } else {
  36. var colMap = {
  37. label: fieldList[i].MasterLabel,
  38. fieldName: fieldList[i].Id,
  39. type: this.getType(fieldList[i].Field_Type__c)
  40. }
  41. }
  42. colList.push(colMap);
  43. }
  44.  
  45. component.set("v.columns", colList);
  46.  
  47. console.log("colList:");
  48. console.log(colList);
  49. },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement