Cell hint. Gwt

I use pure GWT. How can I implement dynamic different tooltips for each cell. Or, if it is difficult to implement, how to implement a different hint for eveery ROW? thank

+5
source share
1 answer

you can do it, look a very good example .

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);
+1
source

All Articles