i am trying to save the selected data into some local variable but it was saving as id
i need full data to be save in the local or RI
this is my code:
a!localVariables( local!items: { a!map(id: 1, firstName: "John"), a!map(id: 2, firstName: "Michael"), a!map(id: 3, firstName: "Mary") }, local!selectedReport, local!data, a!gridLayout( headerCells: { a!gridLayoutHeaderCell(label: "Summary"), a!gridLayoutHeaderCell(label: "Qty", align: "RIGHT"), }, columnConfigs: { a!gridLayoutColumnConfig(width: "DISTRIBUTE", weight: 5), a!gridLayoutColumnConfig(width: "DISTRIBUTE"), }, rows: a!forEach( items: local!items, expression: { a!gridRowLayout( id: fv!index, contents: { a!textField( /* Labels are not visible in grid cells but are necessary to meet accessibility requirements */ label: "summary " & fv!index, value: fv!item.firstName, readOnly: true ), a!integerField( value: fv!item.id, readOnly: true, align: "RIGHT" ), } ) } ), selectable: true, selectionValue: local!data, /* Flatten the selected values so the result is easier to work with */ /* when the select/deselect all option is used in an editable grid */ selectionSaveInto: { local!data, if( count(local!data) = count(local!items), a!save(local!data, 1), if( count(local!data) > 1, local!data << ldrop(local!data, 1), {} ) ) } ), )
Discussion posts and replies are publicly visible
That is expected. The grid always stores the identifier of the selected item.
what i Should do if i want to get whole data of the selected recoed into some variables ?
By default, the grid will only save the identifier of the selected item. If you want to store whole data, you have to access the index of that item from your list of data using the identifier value and store it in a local variable. See below code for reference:
index( local!items, wherecontains(tointeger(local!data), local!items.id), {} )
thanks it is working