How to do colspan and rowspan to jqGrid header?

psms picture psms · Jan 5, 2015 · Viewed 7.4k times · Source

Kindly see the following image.

enter image description here

How would I achieve the same span in cols and rows ?

Answer

C.P. picture C.P. · Jan 5, 2015

Here is the demo for the table structure you are looking for

Demo

In left panel, go to 'Frozen Cols.Group Header(new)'. Under that go to 'Group Header - with colspan style' & check out grid configuration.

You need to call 'setGroupHeaders' method like this:

jQuery("#id").jqGrid('setGroupHeaders', {
  useColSpanStyle: true,   
  groupHeaders:[{startColumnName: 'Permanent', numberOfColumns: 2, titleText: 'group 1'}]
});

Documentation Link