function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Hitesh KhannaHitesh Khanna 

How to make a text field value clickable ?

Hi,
I have one field in my lightning-datatable and i want to make its value as link , so that it can download through a url provided .
how do i achieve that ?
{ label: 'File Uploaded',  fieldName: 'Title', sortable:true}

NOTE: I have tried giving the type:url' for the field but it converts the value to https://. for e.g field value is abc, it displays it as https:/ab.com/ which is not what i want.
mukesh guptamukesh gupta
Hi Hitesh,

Please follow below url for your solution approach:-

https://www.salesforcecodecrack.com/2020/12/hyperlink-record-in-lightning-datatable.html
https://sfdcpanther.com/how-to-add-hyperlink-and-icons-in-lightningdatatable/

if you need any assistanse, Please let me know!!

Kindly mark my solution as the best answer if it helps you.

Thanks
Mukesh 
Hitesh KhannaHitesh Khanna
Hi Mukesh,
I tried it but the url is not redirecting me to my desired website. like for my use case i want it to land on google.com . so instead of 
typeAttributes: {
            label: { 
                fieldName: 'Subject' 
            },
            target : '_blank'
        }

I wrote this :
typeAttributes: {
            label: { 
                fieldName: 'Subject' 
            },
            target : 'www.ggogle.com'
        }

but its not redirecting me to google .
Hitesh KhannaHitesh Khanna
google*
Siva Krishna KondapalliSiva Krishna Kondapalli
Hello Hitesh Khanna,

Try This,
This Might help you to find your solution as i searched for the same thing and found this - 

<input type="text"  Value =  <a href= "Link Given" </a> onclick="changeHref()">Click the link </a>
You might refer these for better understanding to make the solution
 stackoverflow.com/questions/6959484/link-inside-of-input-tag 
 stackoverflow.com/questions/6959484/link-inside-of-input-tag

Please Mark my answer as the best one, if this helps you

Thanks 
K.Siva Krishna