newbie2000
newbie2000

Reputation: 83

Issue with cell double-click

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

Answers (2)

Aravind
Aravind

Reputation: 21

Add editable: true property in your column defs

Upvotes: 1

anotha_beltalowda
anotha_beltalowda

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

Cell Editing

Upvotes: 2

Related Questions