开发者

Alternating row colors for GWT CellTable

开发者 https://www.devze.com 2023-03-11 21:42 出处:网络
I\'m extending the GWT celltable, and I\'d like to override the default row striping with my own styles. The documentation seems to indicate that the celltable should implement RowStyles interface, wh

I'm extending the GWT celltable, and I'd like to override the default row striping with my own styles. The documentation seems to indicate that the celltable should implement RowStyles interface, which I have:

@Override
public String getStyleNames(Object row, int rowIndex) {
    if(rowIndex == 0 || rowIndex % 2 == 0)
        return "even_row";

    return "odd_row";   
}

However, it's not applying the style - It's not even hitting the method. If I'm extending the GWT CellTable, then it should be ca开发者_开发技巧lling this method to apply the row style, right?

Anyone have this working and can tell me what I'm missing...?


Have a look at this page, specifically the last post on the page. It gives a good example of how to do this.

Implement the RowStyles interface and call this:

this.setRowStyles(this);
0

精彩评论

暂无评论...
验证码 换一张
取 消