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
not exact grouping (case insensitive or grouping by intervals of values)
22/04/2013
20:30
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Hello Tony,

I answerd just now on the following question on the stackoverflow. The question was about case insensitive grouping. I remember before about close "not exact grouping" like grouping my year of by month and year instead of exact date values.

It seems to me that canging just one line of code allow to implement all the requirements. I suggest to change the line of code

if( typeof v !== "object" && grp.lastvalues[i] !== v ) {

to the following

if (typeof v !== "object" &&
        ($.isFunction(grp.isInTheSameGroup) ?
         !grp.isInTheSameGroup(grp.lastvalues[i], v) :
grp.lastvalues[i] !== v)) { 

after that one could define groupingView with additional callback function isInTheSameGroup for example like the following

grouping: true,
groupingView: {
    ...
    groupField: ["name"], // the column by which we group
    isInTheSameGroup: function (x, y) {
        return String(x).toLowerCase() === String(y).toLowerCase();
    }

The demo demonstrates the results. It displays the results like below

Image Enlarger

I don't tested grouping of multilevel, but I hope it should work too.

I think that implementation of the feature could be intresting for other users of jqGrid.

Bes regards
Oleg

24/04/2013
14:13
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Hello Tony

The pull request contains very simple changes in grouping module of jqGrid (one line was modified and tree lines was added), but it implement more advanced version of grouping.

The demo demonstrate the results which look like

Image Enlarger

Best regards
Oleg 

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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