4

I'd like to know if it's possible to merge cells in a GXT Grid like this:

merged cells

I suppose I have to override a renderer, but cannot find which one.
Can someone show me the way using GXT 3.0 ?

NiziL
  • 5,068
  • 23
  • 33

1 Answers1

1

Here is how I edit a cell in a grid in gxt 3. In this example I am just adding a div so I can add an id for selenium testing:

ColumnConfig<LessonOFY, String> name = new ColumnConfig<LessonOFY, String>(lessonProperties.name(), 250, i18n.lessonName());

AbstractCell<String> c2 = getTestingLabel(GAE_ID_CONSTANTS.IDS.LESSON_GRID.toString());

name.setCell(c2);


public static AbstractCell<String> getTestingLabel(final String label) {
    AbstractCell<String> c2 = new AbstractCell<String>() {

        @Override public void render(com.google.gwt.cell.client.Cell.Context context, String value, SafeHtmlBuilder sb) {

            value = "<div id=\"" + label + "\">" + value + "</div>";
            sb.appendHtmlConstant(value);
        }

    };
    return c2;
}

value is just the value that would have been set in the grid orignally

Now that you raised the question, I really want to do the same thing. Let me know how it goes if you will. Please!

user1258245
  • 3,639
  • 2
  • 18
  • 23