kendo ui网格与堆积的列

时间:2015-10-16 11:24:18

标签: user-interface kendo-ui

我正在使用Kendo ui网格来显示数据。现在我要合并三列。 像这样的东西。 enter image description here

1 个答案:

答案 0 :(得分:0)

在您的数据中,您可以输入html换行符<br />

var data = [
    {Id: 1, Location: "Long Side/Short Side<br />Sewer Septic<br />Meter location"},
    {Id: 2, Location: "Long side"},
    {Id: 3, Location: "sewer"},
    {Id: 4, Location: "North-east"},               
];

然后在为网格定义列时,将 encoded 属性设置为false,以便将内容视为html:

$("#grid").kendoGrid({
    dataSource: data,
    columns: [
        { field: "Id", title: "ID",  },
        { field: "Location", title: "Location", encoded: false },
    ]
});
  

<强> DEMO