I\'m using the column reordering feature in jqGrid
$grid = jQuery(\"#list\").jqGrid({
sortable:true,
...
});
Is there an event that fir
There is a call in grid.jqueryui.js (jqGrid v3.8.2) in update() to ts.p.sortable.update() as discussed on the jqGrid message board, so:
jQuery('#gridId').jqGrid({
...,
sortable: { update: function(permutation) {
alert('save permutation somewhere');
},
...
});
However, please note that the array passed to your callback will be relative to the current column order. In other words, saving the array as is after moving multiple columns will not produce the desired results.
I had to do something like this:
var defaultColNames = [ 'Alpha', 'Beta', 'Gamma' ];
var defaultColModel = [
{ name: 'alpha', index: 'alpha' },
{ name: 'beta', index: 'beta' },
{ name: 'gamma', index: 'gamma' }
];
jQuery('#gridId').jqGrid({
...,
colNames: defaultColNames,
colModel: defaultColModel,
sortable: { update: function(relativeColumnOrder) {
var grid = jQuery('#gridId');
var defaultColIndicies = [];
for( var i=0; i