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
jqGrid 3.8 Grouping on INT
05/10/2010
21:09
Avatar
kmanpro
Member
Members
Forum Posts: 4
Member Since:
05/10/2010
sp_UserOfflineSmall Offline

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?

06/10/2010
08:25
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

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.

06/10/2010
17:25
Avatar
kmanpro
Member
Members
Forum Posts: 4
Member Since:
05/10/2010
sp_UserOfflineSmall Offline

tony said:

Hello,

Thanks. I have made some changes in this direction.

You can get the code from GitHub and test it.

Regards

Tony


Thanks but now I am getting this error thrown :

"jqGrid - No such method: groupingSetup"

08/10/2010
18:17
Avatar
kmanpro
Member
Members
Forum Posts: 4
Member Since:
05/10/2010
sp_UserOfflineSmall Offline

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

08/10/2010
18:26
Avatar
kmanpro
Member
Members
Forum Posts: 4
Member Since:
05/10/2010
sp_UserOfflineSmall Offline

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;
 },

23/10/2010
10:52
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

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.

Forum Timezone: Europe/Sofia

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.com

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

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information