【问题标题】:change of edited cell color and save style with Ag Grid使用 Ag Grid 更改已编辑的单元格颜色和保存样式
【发布时间】:2019-11-27 05:54:17
【问题描述】:

我需要为编辑的单元格提供背景颜色 我找到了这个方法,但是它改变了编辑单元格的列颜色。

const cell = params.api.getFocusedCell();
if (params.oldValue !== params.newValue) {
cell.column.colDef.cellStyle = {fontWeight: '550',background: 'coral'};
params.api.redrawRows()
}
params.api.refreshCells(cell);
}

【问题讨论】:

    标签: angular ag-grid


    【解决方案1】:

    尝试改变

    cell.column.colDef.cellStyle = {fontWeight: '550',background: 'coral'};
    

    cell.style.background = 'coral';
    cell.style.fontWeight = '550';
    

    【讨论】:

    • 感谢您的快速回答。但它不起作用
    猜你喜欢
    • 2021-09-10
    • 1970-01-01
    • 2020-09-25
    • 2022-08-23
    • 2019-08-04
    • 1970-01-01
    • 2019-08-30
    • 1970-01-01
    • 2019-08-24
    相关资源
    最近更新 更多