How to get a list of hyperlinks in a Grid row

2 posts, 0 answers
  1. Sarthak
    Sarthak avatar
    1 posts
    Member since:
    Jun 2017

    Posted 17 Jun 2017 Link to this post

    $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.

     

  2. Georgi
    Admin
    Georgi avatar
    658 posts

    Posted 19 Jun 2017 Link to this post

    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.
Back to Top