【发布时间】:2018-05-18 14:53:33
【问题描述】:
我有一个 ag-grid,我想在其中自定义行的背景颜色。
onGridReady(params) {
this.gridApi = params.api;
this.gridColumnApi = params.columnApi;
params.api.sizeColumnsToFit();
this.initialize();
this.gridOptions.getRowStyle = this.changeRowColor;
}
这里是changeRowColor:
changeRowColor(params) {
return {
'background-color': params.data.backgroundColor
};
}
问题是当我启用 [rowSelection]="'multiple'" 时,选定的行没有突出显示。通过注释掉 getRowStyle,我确定这两个功能不兼容。当我这样做时,行会在选择时突出显示。
有人有解决方法的想法吗?
【问题讨论】: