我使用纯GWT.我如何为每个单元格实现动态的不同工具提示.或者如果难以实现,如何为eveery ROW实现不同的工具提示?谢谢
你可以看一下一个很好的例子。
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)
| 归档时间: |
|
| 查看次数: |
1301 次 |
| 最近记录: |