a!gridRowLayOut() sorting: How to save sort order in grid?

The program sorts grid rows using the ImageGrid() -->  "MOVE_UP" and "MOVE_DOWN" approach (Code copied below). Currently, when I re-launch the program all sorts are undone. I want the grid to save the new order after rows have been moved around.Is that possible? Is there an out of the box function I can use? If you can, please share an example. 

a!imageField(

label: "delete " & fv!index,
images: a!documentImage(
document: a!iconIndicator(
"MOVE_UP"
),
altText: "Remove",
caption: "Move Up: " & fv!item.name,
link: a!dynamicLink(
value: fv!index,
saveInto: {
if(
fv!index = 1,
{},
{
a!save(
local!A,
insert(
local!A,
fv!item,
fv!index - 1
)
),
a!save(
local!A,
remove(
local!A,
fv!index + 1
)
)
}
)
}
)
),
size: "ICON"
),

  Discussion posts and replies are publicly visible

Parents Reply Children
No Data