Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
setGroupHeaders error when there is more than one column header
22/02/2014
15:15
Avatar
jmjimenez
New Member
Members
Forum Posts: 1
Member Since:
22/02/2014
sp_UserOfflineSmall Offline

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!!

24/02/2014
12:34
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

25/03/2014
18:32
Avatar
tmondelli
Houston
Member
Members
Forum Posts: 4
Member Since:
23/09/2013
sp_UserOfflineSmall Offline

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?

Stack Overflow

Oleg's example report

26/03/2014
07:26
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

27/03/2014
16:55
Avatar
tmondelli
Houston
Member
Members
Forum Posts: 4
Member Since:
23/09/2013
sp_UserOfflineSmall Offline

What I'm really after is whether or not there will be the ability to create mulitple group header lines within the API for jqGrid. If not, then I will continue on with the hack that I am creating now.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
47 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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information