用于kendo ui网格组标头的子组标头

时间:2013-03-20 07:01:09

标签: kendo-ui kendo-grid

我正在尝试相应地对数据进行分组

Department A(Group)
    Class 1(Sub Group)
        Morning
        Afternoon
        Evening
    Class 2(Sub Group)
        Morning
        Afternoon
        Evening
Department B(Group)

Kendo ui网格分组中的任何可能性......

1 个答案:

答案 0 :(得分:6)

是的,这可以通过Kendo UI Grid实现。以下是一些示例代码:

$("#grid").kendoGrid({
  dataSource: {
    data: [ { 
      department: "A",
      "class": 1,
      type: "Evening"
    },{ 
      department: "A",
      "class": 2,
      type: "Morning"
    }, { 
      department: "B",
      "class": 1,
      type: "Evening"
    }, { 
      department: "B",
      "class": 2,
      type: "Morning"
    }],
    // group by "department" and "class"
    group: [ { field: "department" }, { field: "class" } ] 
  },
  columns: [ { field: "type" } ]
});

现场演示:http://jsbin.com/ejalut/1/edit