简体   繁体   中英

How to merge grid cell in GXT

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

合并细胞

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

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!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM