ejgrid列中的Syncfusion超链接

时间:2016-03-06 12:53:21

标签: syncfusion

有谁知道我如何在下面的代码中为Username列添加超链接?

$("#ManagerApprovalGrid").ejGrid({
                        dataSource: data,
                        isResponsive: true,
                        allowScrolling: true,
                        allowFiltering: true,
                        allowSorting: true,
                        columns: [
                            { field: "userDispName", headerText: 'Timesheet User', textAlign: ej.TextAlign.Left, width: 20}, 
                            { field: "weekEndDate", headerText: 'Week End Date', textAlign: ej.TextAlign.Center, width: 20 }

                        ]

                    });

由于 DEE

1 个答案:

答案 0 :(得分:1)

请参阅以下知识库,将超链接放在ejGrid

https://www.syncfusion.com/kb/3767

<强>更新

ejGrid使用JSRender模板呈现其内容。所以你可以像下面这样把参数传递给超链接。

$("#ManagerApprovalGrid").ejGrid({
                   . . . . . 
                    columns: [
                       { 
                         field: "userDispName", 
                         template:"<a href=something/{{:userDispName}}>View</a>" 
                         headerText: 'Timesheet User',
                         textAlign: ej.TextAlign.Left, width: 20
                      }, 
                       . . . . 

                    ]

                });

演示: http://jsplayground.syncfusion.com/nvoeeoel