Forum


15:44

17/05/2009

hello,
I would like to totally change the sort behaviour (in an experimental way).
I know of the onSortCol event; but I also know that it does not allow to "abandon" the sorting in a regular way.
So I would like to provide my own sortData method. Is there a more "release-robust" way then to patch into grid.base.js ?
My dream is "monkey-patching", after loading jquery and jqgrid having an additional code with
jqGrid.sortData=function (index, idxcol,reload,sor) {
// my own implementation
}
can somebody give me a hint how to do this monkey-patching?
best wishes
Harald
17:29

Moderators
30/10/2007

Hello,
Good point. Also for now not possible, but maybe one possible solution is to use the onSortCol event and depending on what this event return to enable/disable the remaining processing. Will think on this.
Thanks
Best 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.
16:34

17/05/2009

....sorry, wanted to "replay" and not "report"....
I think using onSortCol is a really good idea, the fitting patch would be:
if($.isFunction(ts.p.onSortCol)) {if (ts.p.onSortCol.call(ts,index,idxcol,so)=='stop') {return;}}
I recommend using "stop" as communication value instead of 0,1 or true or false, as the effect on existing usages would be minimal.
best wishes,
Harald
16:59

Moderators
30/10/2007

Hello,
Thanks Harald - I will add this definetley into the code
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:
58 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