Forum


22:53

04/01/2012

I've been tearing my hair out on this one. Whether I try to implement column re-ordering via header dragging or via the column chooser plugin, after re-ordering the columns, clicking on any column header to sort results in the sorted columns being loaded into their original positions in the table. I've tried the suggestions posted here but nothing seems to work. Using the sortable method:
sortable: {
options: {
stop: function(event, ui){
// have tried putting the remapcolumns function inside stop() to no avail
$("#mainGrid").jqGrid("remapColumns", [0,1,2,3,4,5,6,7,8,9,10,11,12], true);
}
},
update: function (perm) {
/*
* code to save the new colmodel goes here
*/
// the following line doesn't seem to do anything... just seems to return an array identical to 'perm'
$("#mainGrid").jqGrid("getGridParam", "remapColumns");
// if included, the next line causes the headers to not move
$("#mainGrid").jqGrid("remapColumns", perm, true);
// this alternate allows them to move, but the newly sorted columns still get remapped to their original position
$("#mainGrid").jqGrid("remapColumns", [0,1,2,3,4,5,6,7,8,9,10,11,12], true);
}
}
After reordering, I can see that the data is being returned from the server in the expected order after sorting. What am I missing?
BTW, this is using jqGrid 4.4.1.
Most Users Ever Online: 715
Currently Online:
38 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