Hi @yonkersyinks,
You can achieve the bulk update, but you'll need to create a script that gathers the primary key info from your table, then calls your update function for each row, passing in the required filter and update data.
The changeSetObject
property has the row id from your table data, which you can use to collect you PK data. So on your table, set the Save event handle to be a script like the one below.
const changedRowIds = Object.keys(train_plan.changesetObject)
const changes = changedRowIds.map(rowId => {
const {symbol, plan_id, model_id, execution_s} = train_plan.data[rowId]
const changes = train_plan.changesetObject[rowId]
return {
filter: { symbol, plan_id, model_id, execution_s},
changes
}
})
// Now you have an array of objects with the changes and filter info you need. So call your updater function
// Do it as an array of promises in case you have a lot of change or a slow query.
const promises = changeData.map(change => {
let {filter, changes} = change
return yourQuery.trigger({additionalScope: {filter, changes}})
})
await Promise.all(promises)
//Refresh your table
train_plan.refresh()
And yourQuery
would look like this:
(don't worry about all the red warnings)