简体   繁体   English

如何在wijmo中为嵌套的子项添加CssClass

[英]How to add CssClass for nested childrows in wijmo

I have a requirement to add cssClass for nested child rows. 我需要为嵌套的子行添加cssClass。 I can add class for parent row but how to add nested child rows. 我可以为父行添加类,但是如何添加嵌套的子行。

this.dataGrid.rows[i].cssClass

You need to add an event handler for the formatItem event of FlexGrid and then iterate over all the rows and set their cssClass property. 您需要为FlexGrid的formatItem事件添加事件处理程序,然后迭代所有行并设置其cssClass属性。

JS: JS:

grid.formatItem.addHandler((s, e) => {
    s.rows.forEach(r => {
        r.cssClass = 'custom-back';
    })
});

CSS: CSS:

.custom-back {
  background: rgb(18, 148, 148) !important;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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