0

I need to have a cell value which has a string value such as "www.google.com" as a URL or a hyperlink. I don't want all the rows for a column to have url , so type = 'url' while defining columns won't work. Link of the playground - https://developer.salesforce.com/docs/component-library/tools/playground/kPSqiPxWk/5/edit Also added the screenshot below. Here , 3rd row (Image) column - 'Change Value' has text - www.google.com , but it's not clickable. I want this text to be url or hyperlink.enter image description here

1

I think you are looking for linkify type attribute for "text" column type.

const columns = [
    { label: 'Column', fieldName: 'anyText', type: 'text', typeAttributes: { linkify: true }},
    // other column data
]
| improve this answer | |
  • Thanks. It worked. I will get rid of the html table – Manish Anand May 8 at 4:46
0

I was trying to achieve recently similar functionality - but not sure if you can have the exact dynamic column format type per row you suggested here. However, you may either have the Change Values column as text or url where you can style the cells text as you wish using cellAttributes to look like a url.

To make it clickable url - you can explorer rowActions with type button where you can style that dynamically.

Similar example is shared on answer here - where you can check on your JS that only when value is a url formal you will invoke this action and when not make it different style.

| improve this answer | |
-1

You will have to change your records dataset and then formatting of columns. I have updated the playground Playground

| improve this answer | |
  • I don't want all the rows to have URL, rather a specific cell. In the above screenshot, I want 3rd row , to have the url – Manish Anand Apr 8 at 7:53

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.