Reputation: 83
On reactJS ag-grid, I need to be able to edit a cell on double clicking. I tried the following code. I do not see any error message popping up. But the cell is still read-only. Am I missing something here please?
Thanks.
function myTest(props)
{
const[gridApi, setGridApi] = userState(null);
...
...
const onCellDoubleClicked = (params) =>
{
gridApi.startEditingCell({rowIndex: params.node.id, colKey: "testField"});
}
const onGridReady = (params) =>
{
setGridApi(params.api);
}
....
...
{headerName:'Test', field:'testField', editable:false};
<AgGridReact columnDefs={...} rowData={...} onCellDoubleClicked=
{onCellDoubleClicked} onGridReady={onGridReady}>
}
Upvotes: 0
Views: 894
Reputation: 51
Tough to say without seeing your coldef - I'd venture that you need to set the column(s) whose cells you want to be editable
to true. See the docs below
Upvotes: 2