我使用纯GWT。我如何为每个单元格实现动态的不同工具提示。或者如果难以实现,如何为eveery ROW实现不同的工具提示? 感谢
答案 0 :(得分:1)
你可以看一下它的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);