2011-12-29 11 views
5

私は純粋なGWTを使用します。どのように私はすべてのセルのための動的な異なるツールチップを実装することができます。あるいは実装が難しい場合は、eveery ROW用の異なるツールチップを実装する方法は? ありがとうセル上のツールチップ。 GWT

答えて

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); 
+3

この例は、Smart GWTにのみ適用できます。純粋なGWTの例が必要です。ありがとう – MyTitle

関連する問題