Action Column Render
User Function which provides custom rendering for an Action Column
info
If no implementation is provided for this User Function, the standard Action button is displayed
Definition
handler: (params: ActionColumnRenderParams) => string;
The function returns a string giving the full render contents of the Button that should display in the cell.
It receives an ActionColumnRenderParams object which is defined as follows:
Property | Description |
---|---|
column | The ActionColumn being rendered |
rowData | The data in the current row being rendered |
rowNode | The row node being currently rendered |
Example
// Predefined Config
export default {
ActionColumn: {
ActionColumns: [
{
ColumnId: 'Action',
ButtonText: 'Click',
RenderFunction: 'action',
},
]
},
} as PredefinedConfig;
// Adaptable Options
const adaptableOptions: AdaptableOptions = {
userFunctions: [
{
type: 'ActionColumnRenderFunction',
name: 'action',
handler(params: ActionColumnRenderParams) {
let data: number = params.rowData.notional;
return data > 50
? '<button class="doublebutton">Double</button>'
: '<button class="treblebutton">Treble</button>';
},
},
],