I am trying to implement a hover text for when a user moves mouse over a ListGrid record to show some extra information that I do not want to be part of the ListGrid itself. I have successfully implemented the RowHoverHandler mechanism, but when I try to define that I do not want the hover text to wrap, I hit a wall.
A simple code case of what I am trying to achieve and what I get can be seen below and in the attached files. I am using latest svn smartgwt code and GWT 2.0.4 (dev and host modes), Chrome dev latest and FF 3.6.8 under Linux Ubuntu 10.04.1 LTS.
A simple code case of what I am trying to achieve and what I get can be seen below and in the attached files. I am using latest svn smartgwt code and GWT 2.0.4 (dev and host modes), Chrome dev latest and FF 3.6.8 under Linux Ubuntu 10.04.1 LTS.
Code:
@Override
public void onModuleLoad() {
Canvas canvas = new Canvas();
final ListGrid countryGrid = new ListGrid();
countryGrid.setWidth(500);
countryGrid.setHeight(224);
countryGrid.setShowAllRecords(true);
countryGrid.setAlternateRecordStyles(true);
countryGrid.setCanHover(true);
countryGrid.setHoverWrap(false);
ListGridField nameField = new ListGridField("countryName", "Country");
ListGridField continentField = new ListGridField("continent", "Continent");
ListGridField countryCodeField = new ListGridField("countryCode", "Country Code");
countryGrid.setFields(nameField, continentField, countryCodeField);
countryGrid.setCanResizeFields(true);
countryGrid.setData(CountryData.getRecords());
countryGrid.addRowHoverHandler(new RowHoverHandler() {
@Override
public void onRowHover(RowHoverEvent event) {
countryGrid.setHoverCustomizer(new HoverCustomizer() {
@Override
public String hoverHTML(Object value, ListGridRecord record, int rowNum,
int colNum) {
GWT.log("On Hover!");
return hoverText;
}
});
}
});
canvas.addChild(countryGrid);
canvas.draw();
}
Comment