React Grid Batch Editing and Transactions
The Batch Editing feature of the IgrGrid is based on the IgrTransactionService. Follow the Transaction Service class hierarchy topic to see an overview of the IgrTransactionService and details how it is implemented.
Below is a detailed example of how is Batch Editing enabled for the IgrGrid component.
React Grid Batch Editing and Transactions Example
The following sample demonstrates a scenario, where the IgrGrid has IgrGrid.batchEditing enabled and has row editing enabled. The latter will ensure that transaction will be added after the entire row edit is confirmed.
Transaction state consists of all the updated, added and deleted rows, and their last states.
Usage
You need to enable IgrGrid.batchEditing from your Grid:
This will ensure a proper instance of Transaction service is provided for the IgrGrid. The proper IgrTransactionService is provided through a TransactionFactory.
After batch editing is enabled, define a IgrGrid with bound data source and IgrGrid.rowEditable set to true and bind:
The following code demonstrates the usage of the IgrTransactionService API - undo, redo, commit.
The transactions API won’t handle end of edit and you’d need to do it by yourself. Otherwise, IgrGrid would stay in edit mode. One way to do that is by calling EndEdit in the respective method.
Disabling IgrGrid.rowEditable property will modify IgrGrid to create transactions on cell change and will not expose row editing overlay in the UI.
API References
Additional Resources
Our community is active and always welcoming to new ideas.