function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sumesh ChandranSumesh Chandran 

Lightning datatable - Have 3 columns with buttons

Hello all,
I am looking to have buttons change color, depending on the value received from the server.  I have a stage column from the Opportunity object, I want the buttons on each column change their color based on the current stage. 
For example, WON - OVERDUE - CLOSED LOST - CLOSED WON,  would be the 4 button columns with fixed titles, depending on the value from the server the buttons should change their colour to green. If the stage is at Overdue the WON & OVERDUE Column button should chnage their background color to green. How to do this?

I was able to put a button the Lightning Datatable with the values from the server.
component.set('v.columns', [     
            {label: 'Opportunity name', fieldName: 'Name', type: 'text'},
            {label: 'Close Date', fieldName: 'CloseDate', type: 'date', editable: 'true', cellAttributes: { iconName: 'utility:event', iconAlternativeText: 'Close Date' }},
            {type: 'button',typeAttributes: { label: {fieldName: 'StageName'}, 
    										  name: 'editRecord', 
    										  title: 'editTitle', 
    										  disabled: false, 
    										  value: 'test',
  }},

Please advise
 
MagulanDuraipandianMagulanDuraipandian
It supports only variant attribute. 
--
Magulan Duraipandian
www.infallibletechie.com