jqGrid组头的“双级”

时间:2017-04-21 12:32:18

标签: jquery jqgrid free-jqgrid

(免费版jqgrid-4.13.6)

是否可以创建群组标题的“双重级别”?

我附上图片以了解我的问题(这只是一张免费的图纸)

enter image description here

1 个答案:

答案 0 :(得分:1)

可以多次拨打setGroupHeaders 来获取您需要的结果。例如代码

$grid.jqGrid("setGroupHeaders", {
    groupHeaders: [
        {startColumnName: "name", numberOfColumns: 2, titleText: "Main information"},
        {startColumnName: "amount", numberOfColumns: 5, titleText: "Details"}
    ]
})
.jqGrid("setGroupHeaders", {
    groupHeaders: [
        {startColumnName: "amount", numberOfColumns: 3, titleText: "<em>Price</em>"},
        {startColumnName: "closed", numberOfColumns: 2, titleText: "Shiping"}
    ]
});

创建两级列标题。请参阅https://jsfiddle.net/OlegKi/8atan0o4/,如下图所示 enter image description here