如何在aggrid angular中使用rowClass在ag grid pinnedBottomRowData上添加背景

ABC*_*ABC 3 javascript ag-grid angular ag-grid-angular

如何在pinnedBottomRowData整个底行添加背景

这是代码

列表.component.ts

  columnDefs = new Array();
  rowData = new Array();
  pinnedBottomRowData: any;
ngOnInit() {
this.columnDefs = [
      {
        'headerName': 'Style/Machine',
        'field': 'total',
      }
    ];
    for (let i = 1; i < 30; i++) {
      this.rowData.push(
        {
          'total': 'Machine ' + i
        }
      );
    }
    this.pinnedBottomRowData = this.createData(1);
}

  createData(count: number) {
    const result = [];
    for (let i = 0; i < count; i++) {
      result.push({
        total: 'Total Machine'
      },
        {
          total: 'Total',
        });
    }
    return result;
  }
Run Code Online (Sandbox Code Playgroud)

这是输出 在此处输入图片说明

在此处输入图片说明

Nar*_*ali 6

You can use getRowStyle and check if the row is pinned and at the bottom. Please refer the below example.

this.getRowStyle = function(params) {
      if (params.node.rowPinned === 'bottom') {
        return { "background-color": "blue" };
      }
    };
    this.pinnedBottomRowData = createData(1, "Bottom");
Run Code Online (Sandbox Code Playgroud)

Plunker

Reference link