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

Help Needed with Client Template Column

2 Answers 33 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Man
Top achievements
Rank 1
Man asked on 16 Sep 2015, 09:03 AM
I have a grid that displays a subset of the entire column set of my model  as follows as a result of my search form

 

$("#kendoResultGrid").kendoGrid({
                            dataSource: {
                                data:response
                            },
                            scrollable: true,
                            sortable: true,
                            columns: [
                                { field: "EmpNo", template: "getLink(response)" },
                                { field:"EmpName" },
                                { field:"EmpMgr" },
                                { field:"ClientName" },                                
                                { field: "FrameworkName",hidden:true }
                            ]
                        });      

 
 function getLink(emp) {
        var action = '@Url.Action("Index","PMP", new { emp = '+ emp +')';
        var empLink = kendo.format("<a href='{0}'>{1}</a>", action, emp.empNo);
        return empLink;
    }
 

I want to be able to pass the current row to my Index method on my PMP view and display employee id as a hyperlink. Can you please assist?

2 Answers, 1 is accepted

Sort by
0
Accepted
Konstantin Dikov
Telerik team
answered on 18 Sep 2015, 06:16 AM
Hi Man,

From the provided information it is not clear what exactly is the problem with your implementation and what is the exact requirement that you have. Generally, if you need to display a hyperlink generated by data fields from the row, you can use the approach from the following dojo example:
If you have something different in mind, please provide additional information on the exact scenario and requirement.


Regards,
Konstantin Dikov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Man
Top achievements
Rank 1
answered on 18 Sep 2015, 11:51 AM

Hi Konstantin,

   I just wanted to be able to access the current row item. I got your answer from the code sample. Thanks

Tags
Grid
Asked by
Man
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Man
Top achievements
Rank 1
Share this question
or