2

所以我有一个 Smart GWT ListGrid,我希望能够使行可扩展,同时对它们进行行跨度。扩展未合并的行(通过行跨度)可以正常工作,但是如果我有几行合并,则扩展图标会消失。我的扩展和跨行代码是这样的:

lisgrid = new LisGrid()
{
    @Override
protected Canvas getExpansionComponent(final ListGridRecord record)
{
    // Add a nested grid to display the remaining requests for the tag
    // (after the first N being shown be default).
    VLayout layout = new VLayout(5);
    layout.setPadding(1);

    final ExtendedListGrid requestGrid = new ExtendedListGrid();
    requestGrid.setWidth(500);
    requestGrid.setHeight(224);
    requestGrid.setCellHeight(22);
    requestGrid.setDataSource(datasource);
    requestGrid.fetchData();

    layout.addMember(requestGrid);

    return layout;
}
};

listGrid.setAllowRowSpanning(true);
listGrid.setCanExpandRecords(true);
listGrid.setMergeCols(new String[] { "requestSummaryTagId", "gca" });

我已经覆盖了 ListGrid 的 getRowSpan 方法以跨越一个单元格,直到它下面的单元格(相同的列索引和下一行索引)具有相同的值,并且我还有一个方法 setMergeCols,它告诉网格要跨越哪些单元格跨行。这是它的样子。如您所见,底部的前 2 个单元格跨越 4 行,但缺少扩展符号,而对于上面的行(没有任何行跨度),扩展符号在那里。知道为什么吗?

在此处输入图像描述

4

0 回答 0