开发者

How to change the color of selected row in gwt-ext grid?

I am want to change the color of selected row of grid (gwt-ext grid) in my application.

For this I have done this:

int rowIndex = getGrid().getStore().indexOf(rec);
Element currentRow = getGrid().getView().getRow(rowIndex);
currentRow.getStyle().setProperty("backgroundColor","red");

But it is permanently changing the color of the row.As I select on another row it previous selected row should be in it previous color.

So I am not getting what to do 开发者_如何转开发the change the color of selected row in the gwt-ext grid.

I also want to know how to change the text color of the grid row?


  1. I think the right was is to add (or modify the existing) css class for the row and not to make this in your java code. The class can you add with addStyleName("myClass").
  2. Alternative (but wrong for me) - you can reset the color for all rows before you set the color for the selected row.
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜