I have a Datagrid, where i need to show the value of the each cell in the tooltip.
If i was using celltable then i can easily set title of each cell in the following way.
cellTable.addCellPreviewHandler(new Handler<GWTEvent>() {
@Override
public void onCellPreview(CellPreviewEvent<GWTEvent> event) {
if ("click".equals(event.getNativeEvent().getType())) {
GWTEvent data1 = event.getValue();
fireEvent(new ClassicViewWidgetClickEvent(eventsList.get(i).getMessageId()));
}
if ("mouseover".equals(event.getNativeEvent().getType())) {
Element cellElement = event.getNativeEvent().getEventTarget().cast();
cellElement.setTitle("Bod Message");
}
}
}
If i wrote the same logic for Datagrid, its just working for click event. mouseover event is not firing. Why its not firing for Datagrid? Actually my main question is how can i set the tile for each cell in datagrid? Is thee any other alternative. Kindly please reply.
For tooltip, create an inner class:
And do the following on mouseover/click of cell,