Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tooltip over cell. GWT

Tags:

java

gwt

I use pure GWT. How i can implement dynamic different tooltips for every cell. Or if it hard to implement, how to implement different tooltip for eveery ROW? thanks

like image 453
WelcomeTo Avatar asked Nov 13 '22 12:11

WelcomeTo


1 Answers

you can do it have a look at a very good example of it.

ListGridField nameField = new ListGridField("countryName", "Country");
ListGridField governmentField = new ListGridField("government", "Government", 120);
governmentField.setShowHover(true);
governmentField.setHoverCustomizer(new HoverCustomizer() {
    public String hoverHTML(Object value, ListGridRecord record, int rowNum, int colNum) {
        CountryRecord countryRecord = (CountryRecord) record;
        int governmentDesc = countryRecord.getGovernmentDesc();
        String[] governmentDescription = new String[]{
          //your data see link for more detail""
  };
        return governmentDescription[governmentDesc];
    }
});

countryGrid.setFields(countryCodeField, nameField, governmentField);
countryGrid.setCanResizeFields(true);
countryGrid.setData(CountryData.getRecords());
canvas.addChild(countryGrid);
like image 89
Hemant Metalia Avatar answered Nov 16 '22 03:11

Hemant Metalia