如何将背景图像添加到网格行

发布于 2025-01-06 09:29:02 字数 383 浏览 4 评论 0原文

如何将背景图像添加到网格的一行中?我可以使用下面的代码更改行的颜色,但它不会添加图像?

    this.getView().getRowClass =  function(record, rowIndex, rowParams, store) {
            return record.get("deleted_dts") ? "rowdeleted" : ""
    };

CSS:

   .row-deleted { background: url("../images/bin.png") no-repeat right center #eeeeee; color: gray; }

谢谢。

How do I add a background image to a row of my grid? I can change the row's colour with the below code but it doesn't add the image?

    this.getView().getRowClass =  function(record, rowIndex, rowParams, store) {
            return record.get("deleted_dts") ? "rowdeleted" : ""
    };

The CSS:

   .row-deleted { background: url("../images/bin.png") no-repeat right center #eeeeee; color: gray; }

Thanks.

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

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

发布评论

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

评论(1

王权女流氓 2025-01-13 09:29:02

CSS 选择器必须定位单元格元素 ('td'),而不是行元素 ('tr'):

.row-deleted .x-grid-cell { 
    background: url("../images/bin.png") no-repeat right center #eeeeee;
}

The CSS selector must target the cell element ('td'), not the row element ('tr'):

.row-deleted .x-grid-cell { 
    background: url("../images/bin.png") no-repeat right center #eeeeee;
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文