1

I have my Aura (yes, I know it's not as cool as LWC) component displaying a datatable. It works great, but I want to have the full text of the field show when I hover over a cell. I can do this in Visualforce using Lightning Design System

<th class="" scope="col">
  <div class="slds-truncate" title="Amount">Amount</div>
</th>

and setting the title to whatever I want.

How do I do this with my lightning datatable?

I'm not sharing my code because I'm using the code in the documentation at https://developer.salesforce.com/docs/component-library/bundle/lightning:datatable/documentation and in https://github.com/AliakseiSasnouski/RelatedList/blob/master/aura/RelatedList/RelatedListController.js and I want my text column to show the full value when I hover over it.

0

It doesn't seem to be possible. As per the "Formatting with Data Types" section on the official Aura documentation, the only base components that support the tooltip attribute is the url type, which uses the lightning:formattedUrl base component. And the only base component that supports the title attribute are the buttons base components (lightning:button and lightning:buttonIcon).

That's not to say that it is impossible to have the title attribute available... if you have the skills, you can create your own data table component following the guidelines in the Lightning Design System.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.