Description
This post will show how to delete selected rows and cell ranges in ag-Grid by pressing the Backspace or Delete keys. We have demonstrated this in live samples in JavaScript, Angular, React and Vue.js.
Summary
- Deleting Selected Rows and Cell Ranges via Key Press in ag-Grid This post will show how to delete selected rows and cell ranges in ag-Grid by pressing the Backspace or Delete keys.
- If you'd like to implement additional custom behaviors on key press, you can learn more about the Suppress Keyboard Event approach in our documentation.
- The range selection object holds which columns are in the range selection and the startIndex and the endIndex of the selected range.
- Now that we know the row indexes and the columns that we need to update, we call the clearCells function to get the rows between the start and end index and update the column fields for the cells selected as shown below: