0

I had a previous question where I asked how to dynamically highlight a cell. This link provided some answers and I was able to highlight cells using 'slds-theme_shade slds-theme_alert-texture'.

How do I do the same using a CSS Class. If I try plug in the class it does not work. Even some example from the link do not work. Only the one mentioned above:

const columns = [
    {
        label: 'EVENT REGISTRATION FIELD NAME', fieldName: 'eventregistrationfieldname', type: 'text',
        cellAttributes: {
            class: { fieldName: 'industryClass' },
        }
    },
    { label: 'SALESFORCE DATA', fieldName: 'salesforcedata', type: 'text' },
    { label: 'EVENT REGISTRATION DATA', fieldName: 'eventregistrationdata', type: 'text' }
];


registrationData.push({
                    ...,
                    'industryClass': eventRegData[key].isSelected ? 'slds-theme_shade slds-theme_alert-texture' : 'defaultText' //works
                    'industryClass': eventRegData[key].isSelected ? '.datatable-orange' : 'defaultText' //does not work. With/without period "."
                });



.datatable-orange {
color: #fff;
background-color: #e06000;
}

1 Answer 1

1

As per the documentation this is not yet supported.

Custom classes are currently not supported. To apply custom styling on your datatable cells, create a custom data type and then apply your custom CSS classes.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .