Search code examples
jqueryjspjquery-uijqgridmvcjqgrid

How to do colspan and rowspan to jqGrid header?


Kindly see the following image.

enter image description here

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


Solution

  • 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