Java – how to merge grid cells in GXT

I wonder if I can merge cells in the GXT grid like this:

I think I have to overwrite the renderer, but I can't find one Can someone tell me how to use GXT 3.0?

Solution

This is how I edit the cells in the grid in GXT 3 In this example, I just add a div, so I can add an ID for selenium test:

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 set in the grid

Now that you have raised the question, I really want to do the same thing Please let me know if you like Please!

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>