View Full Version : WidgetTreeGridCellRenderer problem

20 Aug 2009, 7:00 AM

I'm trying to create a TreeGrid with two columns. First of them is a tree and the other one is a column with buttons. My code is the next:

BaseTreeModel baseTreeModel = new BaseTreeModel();
baseTreeModel.set("concepto", "Prueba");
baseTreeModel.set("opciones", "Widget");

ColumnConfig concepto = new ColumnConfig("concepto", "Concepto", 350);
concepto.setRenderer(new TreeGridCellRenderer<BaseTreeModel>());

ColumnConfig opciones = new ColumnConfig("opciones", "Opciones", 500);
opciones.setRenderer(new WidgetTreeGridCellRenderer<ModelData>() {

public Widget getWidget(ModelData model, String property,
ColumnData config, int rowIndex, int colIndex,
ListStore<ModelData> store, Grid<ModelData> grid) {
return new Text("Hola");

TreeStore<BaseTreeModel> store = new TreeStore<BaseTreeModel>();
store.add(baseTreeModel, true);

TreeGrid<BaseTreeModel> conceptosSeleccionados = new TreeGrid<BaseTreeModel>(store, new ColumnModel(Arrays.asList(concepto,opciones)));
conceptosSeleccionados.setAutoExpandColumn("concepto");My problem is that I can only see data in the first column. Could anybody help me???
What's wrong in my code???