在
cellRenderer
params
interface ICellRendererParams {
value: any, // value to be rendered
valueFormatted: any, // value to be rendered formatted
getValue: ()=> any, // convenience function to get most recent up to date value
setValue: (value: any) => void, // convenience to set the value
formatValue: (value: any) => any, // convenience to format a value using the columns formatter
data: any, // the rows data
node: RowNode, // row rows row node
colDef: ColDef, // the cells column definition
column: Column, // the cells column
rowIndex: number, // the current index of the row (this changes after filter and sort)
api: GridApi, // the grid API
eGridCell: HTMLElement, // the grid's cell, a DOM div element
eParentOfValue: HTMLElement, // the parent DOM item for the cell renderer, same as eGridCell unless using checkbox selection
columnApi: ColumnApi, // grid column API
context: any, // the grid's context
refreshCell: ()=>void // convenience function to refresh the cell
}
所以要进入
row-data
你需要使用
params.data
或
params.node.data
cellRenderer: (params) => {
if (params.data.IsGlobal.value === true)
{
...
}
else
{
...
}
}
但是记住
,此时将使用内联
单元渲染器
-
你可以实现
HTML
模板
它将包含所需的函数等等。
你就不能执行了
component
功能通过
内联实现