Forum
16:16
25/02/2009
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.
11:14
25/02/2009
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 ?
13:35
10/08/2009
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
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.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66