tags:

views:

196

answers:

2

I'm using the column reordering feature in jqGrid

$grid = jQuery("#list").jqGrid({
    sortable:true,
    ...
});

Is there an event that fires after columns are re-ordered? If there is, I can't see it!

Thanks in advance

+1  A: 

The demo for the jqGrid sortable rows plugin says that all available options and events from sortable widget can be used.

If that's right then you should be fine just using the update event that's part of the sortable plugin.

Steerpike
Thanks... I thought that looked promising too. However I still can't figure out how I can set a handler for this event. I've tried adding update: function(event, ui) { alert(""); }when I initialize the grid, and also$("#list").bind("sortupdate", function() { alert(""); });after the grid's initialized. But neither one works for me... Any pointers?
Adam
A: 

This works:

[EDITED]

$('.ui-jqgrid-hbox table', $('#' + gridId).parents('.ui-jqgrid-view')).bind("sortstop", function () { onGridColumnReordered(gridId) })

where you need to pass your gridId and create that onGridColumnReordered function of course.

Mr W