删除 GXT 网格中行之间的空格/线

发布于 2024-11-13 06:00:36 字数 519 浏览 1 评论 0原文

My Problem

我的目标是在网格的某些列之间创建一条实线。为了实现这一点,我对相应的列执行了以下操作:

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

正如您从附图中看到的,行之间似乎有空格,这阻止了我的列边框成为向下的实线。任何人都可以帮助消除行之间的这些线,或者使用其他方法来实现我的目标吗?

我看到网格类型本身提供了一种方法来打开/关闭列线:

grid.setColumnLines(false);

但我没有看到任何行。我也不知道即使对于列,该方法是否隐藏了行或实际上删除了它们 - 我怀疑是前者。

预先感谢您的所有答复。

My problem

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

简美 2024-11-20 06:00:36

嗨,我通过使用一些字符串操作来完成此操作,方法如下;

创建自己一个 GridView (扩展网格视图)并覆盖以下内容

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;
    }

这将在渲染时去除网格中的任何边框

希望它有所帮助

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

你的他你的她 2024-11-20 06:00:36

边框是为类 .x-grid3-row 定义的(应用于行的 div 元素),因此您可以在自定义 .css 文件中覆盖它或删除相应的行来自您的 gxt-all.css (我推荐第一种方法,因为 gxt-all.css 可能会随着未来的 gxt 版本而改变,覆盖您的更改)

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)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文