Sure

replace todaydata.value.map with formatDataAsArray(todaydata.value).map
Does that help?
ok now it worked better but the result on the table is not correct.
The source was: 0.08
Change bid value was 50%
meaning the target should of be: 0.12 (and on the console log it was) but it update the table bid to 0
Also for some reason, it's not marked as changeset meaning when I check maintable.changearray I get no item
maintable.selectedRows.forEach( (item,index) =>
console.log(index+" source: "+todaydata.value.bid_amount[maintable.selectedDataIndexes[index]]);
console.log(index+" target: "+maintable.selectedRows[index].bid_amount*(1 + changebid.value / 100));
todaydata.setValue(todaydata.value.map((x,y) => y == index ? ({...x, bid_amount: item.bid_amount*(1 + changebid.value / 100)}) : x)
)
About the changeset, you wont need it since the todaydata is holding the changes
So how should I send it back to the API?
What I do right now is when the user decides to click on Send update it shows him all the changes that've been done based on the maintable.changesetArray. and then if it is good with him, he click send and it turn it into an API post request ....
As about the code snip
maintable.selectedRows.forEach( (item,index) =>
console.log(index+" source: "+todaydata.value.bid_amount[maintable.selectedDataIndexes[index]]);
console.log(index+" target: "+maintable.selectedRows[index].bid_amount*(1 + changebid.value / 100));
todaydata.setValue(todaydata.value.map((x,y) => y == index ? ({...x, bid_amount: item.bid_amount*(1 + changebid.value / 100)}) : x)
)
Now it doesn't change anything...
Hi @R_S_I_F Sounds like you're close to a solution. If you're still working on this, it could be a good one to chat about in office hours ![]()
