Forum
15:15
22/02/2014
I don't know if it's an error, but I would like to share this situation with you:
If you call setGroupHeaders more than once (for example, it's a common situation in jpPivot when there is more than one yDimension) you need to configure all headers to have the same amount of columns. For example:
$(tblSelect).jqGrid('setGroupHeaders', {
useColSpanStyle: true,
groupHeaders:[
{startColumnName: 'G01G01C01', numberOfColumns: 8, titleText: '2012'},
{startColumnName: 'G02G01C01', numberOfColumns: 8, titleText: '2013'}
]
});
$(tblSelect).jqGrid('setGroupHeaders', {
useColSpanStyle: true,
groupHeaders:[
{startColumnName: 'G01G01C01', numberOfColumns: 4, titleText: 'Trim 1'},
{startColumnName: 'G01G03C01', numberOfColumns: 2, titleText: 'Trim 2'},
{startColumnName: 'G01T01', numberOfColumns: 2, titleText: ''},
{startColumnName: 'G02G01C01', numberOfColumns: 4, titleText: 'Trim 1'},
{startColumnName: 'G02G03C01', numberOfColumns: 2, titleText: 'Trim 2'},
{startColumnName: 'G02T01', numberOfColumns: 2, titleText: ''},
]
});
$(tblSelect).jqGrid('setGroupHeaders', {
useColSpanStyle: true,
groupHeaders:[
{startColumnName: 'G01G01C01', numberOfColumns: 2, titleText: 'Enero'},
{startColumnName: 'G01G02C01', numberOfColumns: 2, titleText: 'Febrero'},
{startColumnName: 'G01G03C01', numberOfColumns: 2, titleText: 'Abril'},
{startColumnName: 'G01T01', numberOfColumns: 2, titleText: 'Total 2012'},
{startColumnName: 'G02G01C01', numberOfColumns: 2, titleText: 'Enero'},
{startColumnName: 'G02G02C01', numberOfColumns: 2, titleText: 'Febrero'},
{startColumnName: 'G02G03C01', numberOfColumns: 2, titleText: 'Abril'},
{startColumnName: 'G02T01', numberOfColumns: 2, titleText: 'Total 2013'}
]
});
I have created 3 levels of headers:
- The first one is per Year
- The second one is for Trimestrer
- The last one is for Month and totals per year
You can see for Trimestrer headers I must create 2 dummy columns to fill the "total" columns. So, this header has 16 columns. If I don't define the dummy columns, the headers are rendered wrong.
thanks for your great work!!
12:34
Moderators
30/10/2007
Hello,
Thank you for finding this.
Can you please prepare for me (or publish online - use source code not min one) simple test case ?
Thanks
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
18:32
23/09/2013
I'm looking for a better resolution to the same problem. I need the ability to create multiple levels of group headers for reports. I've asked on stacked overflow and I received an answer from Oleg (link below), but it is not working great for me. Is there any updates on jqGrid allowing multi-headers?
07:26
Moderators
30/10/2007
Hello,
..but it is not working great for me.
What you mean with this?
Regards
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
Most Users Ever Online: 715
Currently Online:
44 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66