• Enrik Hysko
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
I need to hide the View button inside Lightning Datatable based on Team Group Name in that same row 
User-added image

If team Group name is blank then view button must be hidden and if team group name is not blank then i need to show view button
Here is my code:
columns: [ {label: "Course Title", fieldName: "CourseTitle", type: "text"}, {label: "Team Group Name", fieldName: "TeamGroupName", type: "text"}, {label: "Campus Name", fieldName: "CampusName", type: "text"}, {label: "Course", fieldName: "Course", type: "text"}, {label: "Section ID", fieldName: "SectionID", type: "text"}, {label: "Session", fieldName: "Session", type: "text"}, {label: "Course Level", fieldName: "CourseLevel", type: "text"}, {label: "Term Length", fieldName: "TermLength", type: "text"}, {type: "button", typeAttributes: { label: 'View', name: 'View', title: 'View', disabled: false, value: 'view', iconPosition: 'left' }} ]
Component:
<aura:component implements="force:appHostable" controller="Teams_Controller"> <aura:attribute type="Account[]" name="acctList"/> <aura:attribute name="mycolumns" type="List"/> <aura:handler name="init" value="{!this}" action="{!c.fetchAccounts}"/> <lightning:datatable data="{! v.acctList }" columns="{! v.mycolumns }" keyField="id" hideCheckboxColumn="false" onrowaction="{!c.viewRecord}"/>