Custom Icon FontAweresome with link TreeGrid

Hi!

I need to implement an icon with some link into a treegrid and when the  user click in the icon redirect to the link.

Thanks.


1 Reply

LA Lokesh Arjunan Syncfusion Team October 11, 2021 11:05 AM UTC

Hi Raul 
 
We have validated your query and you can achieve this by rendering icon inside <a> tag using column template. We have shared code snippet and attached sample for your reference. In this sample you can click the icon which will redirect to the other page.  
 
 
To know more about columnTemplate refer the below documentation link: 
 
 
Code Snippet: 
 
Referring icons stylesheet: 
 
 
Icon rendering inside <a> tag: 
<script type="text/x-jsrender" id="columnTemplate"> 
<div style="display:inline-block;position:relative;left:10px;top:1px"> 
            <a rel='nofollow' href=https://www.wikipedia.com> <i class="fa fa-dribbble fa-4x"></i></a> 
</div> 
</script> 
 
 
Referring columnTemplate in Columns Property: 
  columns: [ 
                ………, 
               { headerText: "Resource", isTemplateColumn: true, templateID: "columnTemplate", textAlign: "center" }, 
               ………, 
               ………             
                ],       
 
 
 
 
Regards, 
Lokesh 
 


Loader.
Up arrow icon