开发者

Remove spaces/lines between rows in GXT Grid

Remove spaces/lines between rows in GXT Grid

My goal is to create a solid line between certain columns of a Grid. To accomplish this, I've done the following to the appropriate column:

ColumnConfig colConfig = new ColumnConfig("myID", "My Col Title", 50);
colConfig.setStyle("border-right:solid medium black;");

As you can see from the attached picture, the rows seem to have spaces between them that is preventing my column border from being a solid line going down. Can anyone help with either eliminating these lines between rows, or some alternative to accomplish my goal?

I see there is a method provided on the Grid type itself to turn on/off column lines:

grid.setColumnLines(false);

But I don't see anything for rows. I also don't know whether even for columns that method is hiding the lines or actually removing them - I suspect the former.

Thanks in advance for any and all开发者_如何学编程 answers.


Hi I did this by using a little string manipulation heres how;

Create yourself a GridView (extending Grid View) and override the following

protected String doRender(List<ColumnData> cs, List<ModelData> rows, int startRow, int colCount, boolean stripe) {
        String grab = super.doRender(cs, rows, startRow, colCount, stripe);
        grab = grab.replace("style=\"", "style=\"border:0px none; ");
         return grab;

}

    protected String renderRows(int startRow, int endRow) {
        String grab = super.renderRows(startRow, endRow);
        grab = grab.replace("style=\"", "style=\"border:0px none; ");
        return grab;
    }

this will strip out any borders in grid as its rendered

hope it helps


the border is defined for the class .x-grid3-row (applied on the div-element for the row), so you can just override this in a custom .css-file or delete the corresponding line from your gxt-all.css (i'd recommend the first method, because the gxt-all.css could change with future gxt versions, overwriting your changes)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜