答案 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/,如下图所示