• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

GWT DataGrid Sorting and Coloring Cells (GWT 2.4)

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

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.
Thanks
reply
    Bookmark Topic Watch Topic
  • New Topic