admin管理员组

文章数量:1290942

How to add background in pinnedBottomRowData the entire bottom Row

here's the code

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

here's the output

How to add background in pinnedBottomRowData the entire bottom Row

here's the code

list.ponent.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;
  }

here's the output

Share Improve this question edited Feb 13, 2020 at 14:36 Gilbert Gabriel 4252 gold badges8 silver badges24 bronze badges asked Nov 23, 2019 at 3:47 ABCABC 8326 gold badges20 silver badges45 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 11

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");

Plunker

Reference link

本文标签: