I have a table binded to a datasource which is a production plan model. I have added a button on each row which sends the production plan item to the production when clicked. Note that I have two boolean fields which indicate whether the item is on plan or sent to production. The datasource which is connected to the table has this query builder expressions and only shows planned production lines: planned = :true
My button onClick event code is below:
widget.datasource.item.planned = false;
widget.datasource.item.inProduction = true;
app.datasources.productionPlan.load();
What I want to achieve is I want this button to send item to the production and reload datasource in order to not include the item which is sent to the production. However, these code lines run asynchronously and I think that datasource reloads before boolean changes. Is there any way to make client scripts rows on onClick event of a button run in particular order?