Swap two rows in readable grid

Hi, I have readable grid in which i am using arrow icon, so if I click on that arrow so that row should go up and upper row should come down. I can get all data items from current row, but how I will get data from previous row, So I can apply swapping conditiin

  Discussion posts and replies are publicly visible

Parents
  • I solved the problem by own. This is the logic which I was required.

    a!gridColumn(
    label: "",
    value: a!richTextDisplayField(
    value: a!richTextIcon(
    icon: "arrow-down",
    caption: "Move down",
    link: a!dynamicLink(
    saveInto: {
    a!save(fv!currentPage.data[fv!identifier],fv!currentPage.data[fv!identifier+1]),
    a!save(fv!currentPage.data[fv!identifier+1],fv!row),
    },

    ),
    showWhen: fv!currentPage.startIndex
    )
    )
    )

Reply
  • I solved the problem by own. This is the logic which I was required.

    a!gridColumn(
    label: "",
    value: a!richTextDisplayField(
    value: a!richTextIcon(
    icon: "arrow-down",
    caption: "Move down",
    link: a!dynamicLink(
    saveInto: {
    a!save(fv!currentPage.data[fv!identifier],fv!currentPage.data[fv!identifier+1]),
    a!save(fv!currentPage.data[fv!identifier+1],fv!row),
    },

    ),
    showWhen: fv!currentPage.startIndex
    )
    )
    )

Children