You can use 'done' event of the columnChooser. Here is an example:
var grid = $("list");
grid.navButtonAdd(
'#pager',
{caption:"", buttonicon:"ui-icon-calculator", title:"Column choose",
onClickButton: function() {
grid.jqGrid('columnChooser',
{
"done": function(perm) {
if (perm) {
this.jqGrid("remapColumns", perm, true);
}
// here you can do some additional actions
}
});
}
});
UPDATED: If you define sortable
option as
sortable: {
update: function (permutation) {
alert("sortable.update");
}
}
and not as sortable:true
you will receive the notification about the new order of columns. See the source code of jqGrid for details. The array permutation
with integers has the same meaning as in remapColumns
functions (see my old answer for details).