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;
flex-direction: column;
}
.ag-theme-material {
--ag-value-change-value-highlight-background-color: #f9ff99;
}

View File

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