单元格上的工具提示.GWT

MyT*_*tle 5 java gwt

我使用纯GWT.我如何为每个单元格实现动态的不同工具提示.或者如果难以实现,如何为ev​​eery ROW实现不同的工具提示?谢谢

Hem*_*lia 1

你可以看一下一个很好的例子

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);
Run Code Online (Sandbox Code Playgroud)

  • 我认为这个例子只能应用于Smart GWT。我需要纯 GWT 示例。谢谢 (3认同)