Forum
17:41
10/11/2009
Hi guys,
Love the grid, it has changed my life. I am trying to store the new order of columns whenever the user reorders them. Currently I am using this hack:
$('th[role=columnheader]').mouseup( function() {
setTimeout('reorderColumns(currentSystemID)',1000);
})
function reorderColumns(sys) {
var reorderArray = new Array();
$.each( $('#queue_grid_'+sys).getGridParam('colModel'), function(e,f) {
reorderArray[e] = new Array();
reorderArray[e][0] = f.index;
reorderArray[e][1] = f.width;
// logic for storing these attributes here
// …
})
}
However, sometimes this works and sometimes it doesn't. Is there an actual method triggered by the reorder I can use?
Thanks!!!
Liam
12:15
Moderators
30/10/2007
Hello,
I think yes, if I understand right.
In the gridOptions define
sortable: {options:{here_all the options for sortable widget}}
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.
09:40
04/03/2013
Hi Tony,
If I use like this,
sortable:{
options: {
stop: function(event, ui) {
var d = $("div.ui-jqgrid-sortable",$(ui.item));
console.log('Colomn "'+ d.text() + '" was reorded');
},
update: function(relativeColumnOrder) {
console.log("in update");
}
}
},
The sortability is not working. Though the headers are moving, but the data in the grid is not moving.
You can find the same in this jsbin example. Please suggest on how to go ahead on this.
09:49
04/03/2013
According to this post in trirand forum,
sortable : { options : { <whatever sortable options you want> },
update : function(perumtation) {},
},
This is working great.. thanks to the jqGrid development teams and support communities..
Most Users Ever Online: 715
Currently Online:
46 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