I am trying to emulate the below view in LWC. The description value "Click here for Email Template" should only be hyperlink not the entire value, the value is passed from the apex class. Can anyone help me out how to reach this requirement in LWC.

enter image description here

  • Did you try this? Where are you stuck? Can you show the code you tried? – salesforce-sas Sep 11 '19 at 13:04
  • {const columns = [ {label: 'Time', fieldName: 'activityDateTime', type: 'date', typeAttributes: {day: 'numeric', month: 'short', year: 'numeric', hour: '2-digit', minute: '2-digit', hour12: true}, initialWidth: 175}, {label: 'Event Type', fieldName: 'event_type', type: 'text', initialWidth: 175}, {label: 'Description', fieldName: 'url', type: 'url', typeAttributes: {label: {fieldName: 'description'}, target: '_blank'}} ];} This makes the entire value hyperlink however I am looking only a part of it to be hyperlinked. – Shravan Kumar R. Sep 11 '19 at 13:19

You can create a custom component and add it to the datatable via custom data type. You will also have to create a component to extend the datatable. This answer helps outline that How to use custom LWC lightning component in lightning-datatable

Creating Custom Data Types https://developer.salesforce.com/docs/component-library/bundle/lightning-datatable/documentation

| improve this answer | |

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.