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)
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)
Reference link
| 归档时间: |
|
| 查看次数: |
897 次 |
| 最近记录: |