简体   繁体   中英

How to refresh a single cell in ag-grid

I would like to refresh a single cell in ag-grid. Using the gridApi.refreshCells().

This refresh is called by a piece of code that keeps track of the current and previous cell. So what i would like to do it is to update the previous cell.

I tried the following:

gridApi.refreshCells({columns: [prevColumn], rowNodes: [prevRowNode]});

Note that the prevColumn is of type "Column" and prevRowNode is of type "RowNode"

Calling this works, except that it will refresh an entire column and not just a single cell.

Also refreshing a single row is also not working, which when modifying the above to just use the rowNodes will still update the column.

Thanks you guys!

I'm not sure exactly what you are aiming for. To refresh one cell have you tried gridApi.applyTransaction? https://www.ag-grid.com/javascript-grid/data-update-transactions/

Specifically the example: https://www.ag-grid.com/javascript-grid/data-update-transactions/#example-updating-with-transaction

If this isn't what you need, please could you provide a plunker demonstrating the issue?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM