Skip to main content
Hello.  I am working on a Lightning:datatable with editable fields.  I am trying to conditionally display a button (ideally with hover text) that will display when certain row conditions are met.

I already have classes set up to highlight various cells using cellAttributes and classes, but would like to have another column where the alert is displayed.  

I feel like I'm close, but am missing something. I'd appreciate any assistance/suggestions.

Conditionally display icon in Lightning:datatable cell

Controller.js 

Controller.js

  helperCSS

Am I missing something in my CSS?  SVG, perhaps?

Redoing this in VF is not really an option, at this point.

Thanks for your help.
2 Antworten
  1. 7. Mai 2019, 15:24
    Thank you, Khan.  I have been Googling and reviewing these links and others for the past two weeks, without success.  

    for sfdcmonkey, I do not want to overwrite the numeric value with an icon and can find no way to create a fake column for an icon in datatable.

    https://developer.salesforce.com/forums/?id=9060G0000005aTZQAY  I can't get this to work for my use case.

    I was completely lost on this one:  https://developer.salesforce.com/forums/?id=9060G0000005aTZQAY

    I can't overwrite the values entered with an icon.  I need the user to be able to see, in an adjacent column, some type of alert with hover text explaining what is wrong.  I can't create a  new field to display a formula rendered image (because the user is out of custom fields). For now, I guess I'll just stick a legend into a card beneath the table.

    Is the code I provided above even remotely close???