Handle sorting and filtering on ListGrid

Hi there,

Is it possible to figure out if a ListGrid is sorted and/or filtered? When a ListGrid is sorted or filtered, I want to show a custom label on the screen which says “Grid is filtered or sorted” or something like that…

So if a user changes the initial sorting or filtering, this should be shown. Any ideas? There’s no addSortHandler or addFilterhandler or something on a ListGrid.

Regards,

Kees.

The easiest thing is probably to listen for DataChanged and call getCriteria() / getSort().

Thanks for the quick reply.

I tried the proposed solution, but that doesn’t fire when a user disables a field in the columns menu item.

Any other ideas?

You can use a FieldStateChangedHandler to capture that and then getFields to see which fields are currently visible.

What do you mean “disables a field”? Hides a field? That isn’t a sort or filter operation.