Forum
21:09
05/10/2010
I noticed that when I try to group on a column where the values are integer's I get an error from jqGrid. It looks like it is trying to perform string functions on an integer that is causing the problem...
As a work around I can loop through all my objects before making the jqGrid and convert them to string and it works.
Also, Can the grouping summary be on the same row as the grouping row? I find it to be better to only have one row with the details instead of two.
Any Thoughts?
08:25
Moderators
30/10/2007
Hello,
Thanks. I have made some changes in this direction.
You can get the code from GitHub and test it.
Regards
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:17
05/10/2010
I was able to get past that error because I realized that the jqGrid.grouping.js was not in my autoloader.
I am still getting the same error on line 58 of the grid.grouping.js within the groupingPrepare function. It is trying to do a split and join function on a number and fails because the column I am grouping on is a Number...
I would imagine a simple fix of checking if it is a number or not or doing a toString() would do the trick...
Thanks,
Kaleb
18:26
05/10/2010
I changed the groupingPrepare function to the following modifying lines 58 and 67 and it worked:
groupingPrepare : function (rData, items, gdata, record) {
this.each(function(){
// currently only one level
// Is this a good idea to do it so!!!!?????
var itm = items[0] ? items[0].toString().split(' ').join('') : "";
//Was var itm = items[0] ? items[0].split(' ').join('') : "";
var grp = this.p.groupingView, $t= this;
if(gdata.hasOwnProperty(itm)) {
gdata[itm].push(rData);
} else {
gdata[itm] = [];
gdata[itm].push(rData);
grp.sortitems[0].push(itm);
grp.sortnames[0].push($.trim(itm));
//Was grp.sortnames[0].push($.trim(items[0]));
grp.summaryval[0][itm] = $.extend(true,{},grp.summary[0]);
}
if(grp.groupSummary[0]) {
$.each(grp.summaryval[0][itm],function(i,n) {
if ($.isFunction(this.st)) {
this.v = this.st.call($t, this.v, this.nm, record);
} else {
this.v = $($t).jqGrid('groupingCalculations.'+this.st, this.v, this.nm, record);
}
});
}
});
return gdata;
},
10:52
Moderators
30/10/2007
Hello,
Thanks. Fixed
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.
Most Users Ever Online: 715
Currently Online:
23 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