I am trying to update a row style for on mouse hover.
mappings.addCellPreviewHandler(new Handler<MappingInstructionVO>() {
@Override
public void onCellPreview(CellPreviewEvent<MappingInstructionVO> event) {
if (BrowserEvents.MOUSEOVER.equals(event.getNativeEvent().getType())) {
mappings.getRowElement(event.getValue().getExecutionOrder()).getStyle().setBorderColor("Red");
}
});
I am able wo get row content successfully using:
mappings.getRowElement(event.getValue().getExecutionOrder() - 1).getInnerText());
Any idea why
mappings.getRowElement(event.getValue().getExecutionOrder()).getStyle().setBorderColor("Red");
has no effect?
Thanks
DataGrid has
dataGridHoveredRowstyle defined in its defaultDataGrid.Resources. One option is to override this style in your own ClientBundle.Otherwise, try
EDIT:
You must set "border-collapse: collapse" on your DataGrid.
From the CSS2 specification: