How to place Hyperlink in ejs grid

How to give the first column as a hyperlink in my grid. here is my code 

<ejs-grid [dataSource]='details' [allowPaging]="true" [allowSorting]="true" [pageSettings]='pageSettings'>
<e-columns>
<e-column field='firstName' headerText='First Name' width=60></e-column> </a>
<e-column field='lastName' headerText='Last Name' width=100></e-column>
<e-column field='email' headerText='Email' width=60></e-column>
<e-column field='accountStatus' headerText='Account Status' width=60></e-column>
<e-column field='userType' headerText='User Tpe' width=60></e-column>
</e-columns>
</ejs-grid>

2 Replies

DR Dhivya Rajendran Syncfusion Team June 14, 2018 11:55 AM UTC

Hi Saravana, 
Thanks for contacting Syncfusion support. 

We have analyzed your requirement and created a sample for your reference. In the below sample we have created a hyperlink for the first column by using the template property of columns in Grid. You can also achieve your requirement by using the below way. 

Kindly refer to the below code example and sample for more information.  

import { Component, OnInit } from '@angular/core'; 
import { data } from './datasource'; 
 
@Component({ 
    selector: 'app-container', 
    template: `<ejs-grid [dataSource]='data'> 
                <e-columns> 
                    <e-column headerText='Template column'textAlign='Center'> 
                       <ng-template #template let-data> 
                         <a rel='nofollow' href="#">{{data.OrderID}}</a> 
                        </ng-template> 
                    </e-column> 
                    <e-column field='OrderID' headerText='Order ID'></e-column> 
                    . . . . 
                </e-columns> 
                </ejs-grid>` 
}) 
export class AppComponent implements OnInit { 
 
    public data: Object[]; 
 
    ngOnInit(): void { 
        this.data = data; 
    } 
} 





Regards,
R.Dhivya 



AP Ashwini Paranthaman Syncfusion Team June 15, 2018 07:11 AM UTC

From: [email protected] 
Sent: Thursday, June 14, 2018 8:29 AM
To: Syncfusion Support
Subject: Re: Syncfusion support community forum 138103, How to place Hyperlink in ejs grid, has been updated. 

Thanks, it's working fine now. - Sarvan P

Loader.
Up arrow icon