This is a migrated thread and some comments may be shown as answers.

How to get a list of hyperlinks in a Grid row

1 Answer 222 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sarthak
Top achievements
Rank 1
Sarthak asked on 17 Jun 2017, 10:07 PM
$scope.mainGridOptions = {
                dataSource: {
                    type: "odata",
                    transport: {
                        read: "https://demos.telerik.com/kendo-ui/service/Northwind.svc/Employees"
                    },
                    pageSize: 5,
                    serverPaging: true,
                    serverSorting: true
                },
                sortable: true,
                pageable: true,
                dataBound: function() {
                    this.expandRow(this.tbody.find("tr.k-master-row").first());
                },
                columns: [{
                    field: "FirstName",
                    title: "First Name",
                    width: "120px"
                    },{
                    field: "LastName",
                    title: "Last Name",
                    width: "120px"
                    },{
                    field: "Country",
                    width: "120px"
                    },{
                    field: "City",
                    width: "120px"
                    },
                           {
                           field:"urlList",title:"url",
                           template:"<a href="#=urlList[0]#">#=urlList[0]#</a>"
                           }
 
            ]};

 

Here in the "Url" Column(italic one)  i want to show a list of comma seperated urls .For the time being i'm only able to show the first one. Is there any way i could show all the urls seperated by a comma so that each will open a seperate link.

 

1 Answer, 1 is accepted

Sort by
0
Georgi
Telerik team
answered on 19 Jun 2017, 02:05 PM
Hello Sarthak,

You can iterate through model data using Kendo Templates. The following dojo illustrates how to create a list of coma separated urls template:



Regards,
Georgi
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Sarthak
Top achievements
Rank 1
Answers by
Georgi
Telerik team
Share this question
or