Hello all, I am currently working on an interface that includes an editable grid. Although the backend processes the percentage field modifications correctly, the site displays incorrect values, particularly in some other rows.
Discussion posts and replies are publicly visible
Could you explain the problem a little bit please?
What exactly does this mean?
shivat246139 said:Although the backend processes the percentage field modifications correctly
And what does this mean?
shivat246139 said:the site displays incorrect values, particularly in some other rows
When looking at this code, it seems like you update that ri!record multiple times. I don't think this is intentional.
I'd the problem lies in the way you are doing the update with the indexes. Here's an example of what I think you are trying to achieve.
a!localVariables( local!records: { a!map(percentage: 1), a!map(percentage: 1), a!map(percentage: 1) }, local!indexesToUpdate, local!caseSubmit, { a!gridLayout( headerCells: { a!gridLayoutHeaderCell(label: "%") }, rows: a!forEach( items: local!records, expression: a!gridRowLayout( contents: { a!textField( value: fv!item.percentage, saveInto: { fv!item.percentage, a!save( local!indexesToUpdate, append(local!indexesToUpdate, fv!index) ) } ) } ) ) ), a!buttonArrayLayout( buttons: a!buttonWidget( label: "Submit", saveInto: { a!save( local!caseSubmit, a!localVariables( local!casesToUpdate: index( local!records, local!indexesToUpdate, null ), a!update( local!casesToUpdate, { "createdOn", "createdBy" }, { now(), loggedInUser() } ) ) ), a!save(local!indexesToUpdate, null) } ) ) } )