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
Grouping header, change the title?
15/10/2013
16:16
Avatar
cvneo
Member
Members
Forum Posts: 47
Member Since:
25/02/2009
sp_UserOfflineSmall Offline

Hello,

I try to change the title displayed when grouping on your example I have:

GroupText [<span style="float:right; margin-right:25px;"> {1} Message (s) </ span> <b> {0} </ b> ']

but I would add the contents of another column, how?

I for example:

colModel [
{name: 'ID', index: 'ID', width: 20, align: "center", "key": true, align: "center"},
{name: 'IDListe' index 'IDListe', width: 20, align: "center", hidden: true},
{name: 'NameListe' index 'NameListe', width: 20, align: "center", hidden: true},

so I would:
                    grouping:true,
                    groupingView : {
                        groupField : ['IDListe'],
                        groupColumnShow : [false],
                        GroupText [<span style="float:right; margin-right:25px;"> {here NameListe} </ span> <b> {0} </ b> '],
                        groupCollapse : true,
                        groupOrder: ['asc']

How to replace {NameListe} the content colone NameListe?

Thank you for your help.

19/10/2013
11:14
Avatar
cvneo
Member
Members
Forum Posts: 47
Member Since:
25/02/2009
sp_UserOfflineSmall Offline

I tried that, but nothing in the console.log (data);
I do not see how to get there 🙁

                            {name:'IDListe',index:'IDListe', width:20,align:"center",hidden:true, formatter: function (cellval, opts, rowObject, action) {
                                    var      fullOpts = $.extend({}, $.jgrid.formatter.IDListe, opts),
                                                formatted,
                                            groupIdPrefix = opts.gid + "ghead_",
                                              groupIdPrefixLength = groupIdPrefix.length,
                                              names = [], data, i, l, item;
                                            
                                    
                                    if (opts.rowId.substr(0, groupIdPrefixLength) === groupIdPrefix && typeof action === "undefined") {
                                        
                                       data = $(this).jqGrid("getGridParam", "data");
                                    
                                        console.log(data);
                                
                                       return data['Descriptif'];
                                    }
                             
                                }
                            },

Via this example : http://stackoverflow.com/questions/10803081/jqgrid-grouping-grouptext-formatting-and-modification

Des idées ?

19/10/2013
11:41
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Hi,

try the demo (see the answer). Is it what you try to implement?

Best regards
Oleg

19/10/2013
11:50
Avatar
cvneo
Member
Members
Forum Posts: 47
Member Since:
25/02/2009
sp_UserOfflineSmall Offline

data = $ (this) jqGrid ("getGridParam", "data");

returns nothing so how …. ?

19/10/2013
13:35
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

You post small code fragments only, so it's difficul to understand what you do. I don't understand which relation has your last post to your original question (custom grouping header). The option data (returned by $(this).jqGrid("getGridParam", "data");) are defined only if you use datatype: "local". I don't see any sense to use $(this).jqGrid("getGridParam", "data"); inside of formatter. Formatter callback has rowObject parameter, which contains the data of the currect row. The exact value can depend on other jqGrid parameters (datatype, loadonce) which you use. In general rowObject.NameListe provides probably the value which you need.

Reagrds
Oleg 

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
36 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