In ag-grid
, when I want to retrieve the row index I use:
params.node.id
However, I couldn't find a way to do the same for columns.
All that I found is retrieve the columnId
which refers to the field variable in the column definition.
I.e: If this is the column definition:
{
headerName: "checkButton 2",
field: "checkbuttonTwo",
cellRenderer: "checkButtonComponent",
width: 150
}
This:
params.column.getId()
Would return:
checkbuttonTwo
So my question is:
Is there any way to retrieve the column index?
For example: For the second column I would have 2 and so on and so forth.
Thank you