• Post Reply Bookmark Topic Watch Topic
  • New Topic

GWT DataGrid Sorting and Coloring Cells (GWT 2.4)  RSS feed

Ron Meyer
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I try to sort an DataGrid which has color attributes set to its cell's programmatically.

I've done this via

This works great - note that on the real thing, the color code is different per row object and not static - so CSS does not work here.

I also override the DataGrids redraw method to color the cells like this:

This all works great, but then i switched to ListDataProvider because i needed column sorting.
But this doesnt work, only in some cases, the color is applied.
I believe its a time race.

If the columns sort identically, e.g. the click on Sort would not change the order, due to identical entries,
the color appears. If the order indeed changes, the cells are not colored.
Anyone knows what i'm missing here?

Since dataGrid.redraw() is not triggered by Sorting, i override the onColumnSort method in addition.
The dataGrid.redraw() should run after Sorting is done i believe .....

Any help is appreciated.
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!