如何根据Sencha ExtReact中网格的行数改变行背景颜色?

问题描述 投票:2回答:1

我想根据ExtReact网格中的行数据更改行背景,我在文档中找不到任何选项

extjs grid
1个回答
1
投票

我想你正在寻找Ext.grid.feature.RowBody。您必须覆盖getAdditionalData方法并返回包含rowBodyCls的对象。

Ext.create('Ext.grid.Panel', {
  ...
  features: [{
    ftype: 'rowbody',
    getAdditionalData: function (data, idx, record, orig) {
        // Use the data/record to determine which class to apply, then
        // style the row body in CSS.
        return {
            rowBodyCls: "my-body-class"
        };
    }
  }],
...
© www.soinside.com 2019 - 2024. All rights reserved.