Skip to content

Commit

Permalink
table.Container: bulkUpdateRecords() neomjs#5416
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiu committed Jun 19, 2024
1 parent 8ab2f84 commit 18d17c3
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/table/Container.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,28 @@ class Container extends BaseContainer {
return value || oldValue
}

/**
* In case you want to update multiple existing records in parallel,
* using this method is faster than updating each record one by one.
* At least until we introduce row based vdom updates.
* @param {Object[]} records
*/
bulkUpdateRecords(records) {
let {view} = this;

if (view) {
view.silentVdomUpdate = true;

this.store.items.forEach((record, index) => {
record.set(data[index])
});

view.silentVdomUpdate = false;

view.update()
}
}

/**
* @param {Object[]} columns
* @returns {*}
Expand Down

0 comments on commit 18d17c3

Please sign in to comment.