igx-transaction

November 19, 2025 ยท View on GitHub

TransactionService allows the developers to plug a middleware between given component and its data source. While plugged in TransactionService should collect all the transactions performed in the component without send them to the data source. TransactionService should be able to update the data source and commit all the transactions when needed. A walk through of how to get started can be found here

Usage

@Component({
    providers: [{ provide: IgxGridTransaction, useClass: IgxTransactionImplementation }]
})

Getting Started

Dependencies

To use the TransactionService import the TransactionService:

import { IgxGridTransaction, IgxTransactionService } from "igniteui-angular";

and then inject it in the component's constructor:

    constructor(@Inject(IgxGridTransaction) private _transactions: TransactionService) { };

API

TransactionService

NameDescriptionParameters
enabledReturns whether transaction is enabled for this service-
onStateUpdateEvent fired when transaction state has changed - add transaction, commit all transactions, undo and redo-
canUndoReturns if there are any transactions in the Undo stack-
canRedoReturns if there are any transactions in the Redo stack-
addAdds provided transaction with recordRef if anytransaction, recordRef?
getTransactionLogReturns all recorded transactions in chronological orderid?
undoRemove the last transaction if any-
redoApplies the last undone transaction if any-
getAggregatedChangesReturns aggregated changes from all transactionsmergeChanges
getStateReturns the state of the record with provided idid, pending
getAggregatedValueReturns value of the required id including all uncommitted changesid, mergeChanges
commitApplies all transactions over the provided datadata, id?
clearClears all transactionsid?
startPendingStarts pending transactions. All transactions passed after call to startPending will not be added to transaction log-
endPendingClears all pending transactions and aggregated pending state. If commit is set to true commits pending states as single transactioncommit

HierarchicalTransactionService

NameDescriptionParameters
commitApplies all transactions over the provided datadata, primaryKey, childDataKey, id?