-
12 Dec 2011 10:06 AM #1
TreeGrid text style
TreeGrid text style
Hi everybody.
Using a TreeGrid, how can i change the style of text (that appear near the tree icon) in the TreeGrid, only for some rows? I know it is possible to change the text style in the other columns of the associated grid implementing a GridCellRenderer interface and overriding the render method, but i don't find a similar solution with the class TreeGridCellRenderer.
Thanks.
-
12 Dec 2011 11:27 PM #2
You can use the WidgetTreeGridCellRenderer for the first column. Then you can still determine if you wan't the style of the text to be changed.
example:Code:private final WidgetTreeGridCellRenderer<Folder> renderer = new WidgetTreeGridCellRenderer<Folder>() { @SuppressWarnings("unchecked") @Override public Widget getWidget(Folder model, String property, ColumnData config, int rowIndex, int colIndex, ListStore<Folder> store, Grid<Folder> grid) { String style = model.get(property) == true ? "color: red" : "color:blue"; final StringBuilder html = new StringBuilder("<div style='" + style + "'>" + 10 + "</div>); final Html l = new Html(html.toString()); return l; } };
-
13 Dec 2011 2:22 AM #3
TreeGrid text style
TreeGrid text style
that's really an interesting topic to talk about and please give more suggestions
-
13 Dec 2011 2:38 AM #4
what do you need? Or is this yet another bot? :-)
-
13 Dec 2011 3:26 AM #5
Thank you, the solution code you proposed here works fine!
Sandro


Reply With Quote