Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Insert row without refreshing ag-grid

Tags:

ag-grid

Overview

Formerly in ag-grid version <10.1.0 a row could be added without refreshing the grid in this way:

let model: IRowModel = this.gridOptions.api.getModel();
const skipRefresh = true;

model.addItems( [ obj ], skipRefresh );

Since ag-grid 10.1.0 the addItems() method is deprecated and has been removed completely. The documentation says to use updateRowData() instead:

this.gridOptions.api.updateRowData( { add: [ obj ] } );

The problem is that updateRowData() does always refresh the grid. That drags down the performance of our grid extremely.

Question

How do I add rows without having the grid refreshed automatically in current ag-grid version?

What I've already tried

Suppressing ag-grid's new change detection by setting suppressChangeDetection=true That didn't help. Refresh is still done.

like image 771
Seeschorle Avatar asked Mar 01 '26 05:03

Seeschorle


1 Answers

The problem is that updateRowData() does always refresh the grid." This is not true. api.updateRowData() does not trigger a full refresh. there must be something else you are doing that is causing this.

like image 113
Niall Crosby Avatar answered Mar 04 '26 05:03

Niall Crosby



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!