2
votes

Does anyone tried to create empty ag-grid table and then e.g add values when double-clicked on it?

I want to define number of columns and rows in editor and when saving it create empty ag grid. Is that possible?

1
Hi , did you find any answer or solution for your question other than mentioned below. by @Viqas ?Sumit Patel
@SumitPatel I ended up initializing dinamically initializing an object with empty values based on rows/columns numberuser122222

1 Answers

2
votes

Initialize your ag-grid as usual, then pass in your data with empty values, e.g.

this.gridOptions.rowData = [
            {id: '', value: ''},
            {id: '', value: ''},
            {id: '', value: ''},
            {id: '', value: ''},
            {id: '', value: ''}
        ]

All fields will be empty, then you can let the user edit the fields.

Take a look at this StackBlitz example.