PDA

View Full Version : How to set a tooltip on a grid cell



vdhanda
16 Oct 2008, 11:46 AM
I want to set a tooltip on a grid cell. The best I can come up with is using a GridCellRenderer and returning a SPAN element. Is there a better approach?




ColumnConfig description = new ColumnConfig("description", "Description", 150);
description.setRenderer(new GridCellRenderer<BeanModel>(){
public String render(BeanModel model,
String property,
ColumnData config,
int rowIndex,
int colIndex,
ListStore<BeanModel> store) {
String value = model.get(property).toString();
if ( value != null) {
StringBuilder html = new StringBuilder();
html.append("<span title='");
html.append(value);
html.append("' >");
html.append(value);
html.append("</span>");
value = html.toString();
}

return value;

}
});

gslender
16 Oct 2008, 1:19 PM
I believe the next release will support adding normal tooltips to grid

vigger
16 Oct 2008, 11:24 PM
can we have tooltips for grid rows ? is this available in the current EXT-GWT library ?

thanks !

sbarkdull
11 Dec 2008, 5:47 AM
You might try adapting the technique used in this forum post (http://extjs.com/forum/showthread.php?t=54481) to display tooltips in your grid.