Reputation: 20571
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
Upvotes: 5
Views: 1331
Reputation: 30638
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);
Upvotes: 1