连接Kendo网格列

时间:2013-04-12 05:51:33

标签: php kendo-ui kendo-grid

我要做的是在kendo Grid的单列中连接或合并两列。

我试图这样做但是到目前为止还没有成功搜索它但仍然没有得到怎么做?

我想在单个e-g

中连接两个或三个列
First Name

Middle Name

Last Name

所有应该以单一

显示
Full Name

这是我的一些kendogrid代码。

$("#EmployeeGrid").kendoGrid({
        dataSource:{
            transport: {
                read: "<?php echo base_url() ?>index.php/hr_management/manage_hr/list_view"
            },
            schema:{
                data: "data"
            }
        },

        columns: [
            {
                field: "EmployeeID",
                hidden:true
            },
            {
                field:"LastName"
            },
            { field: "LastName"+"FirstName",
                title:"Full Name"
            },
            {
                field:"City",
                title:"City"
            },
            {
                field:"AddressLine1",
                title:"Address 1"
            },

            {
                field:"WorkPhone",
                title:"WorkPhone"
            },
            {
                field:"MobileNo",
                title:"Mobile No"
            },
            {command: { text: "View", click: showDetails }, title: " ", width: "140px"},
            {command: { text: "Edit", click: EditUserDetails }, title: " ", width: "140px"}
        ]
    });
});

2 个答案:

答案 0 :(得分:3)

答案是使用template列:

template:"#= FirstName # #= MidName # #= LastName #"

答案 1 :(得分:0)

另一个适用于 Angular 8 的示例:

<kendo-grid-column field="LastName" title="Last, First">
      <ng-template kendoGridCellTemplate let-dataItem>
       {{ dataItem.LastName}}, {{ dataItem.FirstName }}
    </ng-template>
</kendo-grid-column>
<kendo-grid-column field="MiddleName" title="Middle"></kendo-grid-column>