Flash added rows

This commit is contained in:
Erki Aas 2022-10-11 19:43:46 +03:00
parent eeb104ee60
commit d0c4272f51
2 changed files with 10 additions and 11 deletions

View File

@ -9,3 +9,7 @@ div#app {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
.ag-theme-material {
--ag-value-change-value-highlight-background-color: #f9ff99;
}

View File

@ -83,7 +83,8 @@ export default {
defaultColDef: { defaultColDef: {
width: 50, width: 50,
initialPinned: true, initialPinned: true,
resizable: true resizable: true,
enableCellChangeFlash: true
}, },
currentRowCount: 0, currentRowCount: 0,
viewRowCount: 20, viewRowCount: 20,
@ -140,18 +141,12 @@ export default {
}, },
handleReceiveMessage (event) { handleReceiveMessage (event) {
const eventData = this.parseEventData(event.data); const eventData = this.parseEventData(event.data);
this.gridApi.updateRowData({add: [eventData]}); const res = this.gridApi.applyTransaction({
this.gridApi.sizeColumnsToFit() add: [eventData]
},
refreshRowData () {
const itemsToUpdate = [];
this.rowData.slice(0 - this.viewRowCount).forEach((row, index) => {
row.index = index
itemsToUpdate.push(row)
}); });
this.gridApi.applyTransactionAsync({ update: itemsToUpdate }); const rowNode = res.add[0]
this.gridApi.flashCells({ rowNodes: [rowNode]});
this.gridApi.sizeColumnsToFit() this.gridApi.sizeColumnsToFit()
this.getComboBoxOptions()
}, },
parseEventData (eventData) { parseEventData (eventData) {
try { try {