Skip to main content
October 20, 2023
Question

Editable Grid move rows to up and down

  • October 20, 2023
  • 2 replies
  • 0 views

I want to add this (Move Raws Up and Down ) functionality for the editable grid.

    2 replies

    stefanhelzle0001
    Brainy
    October 20, 2023
    gabriele.camilli
    October 20, 2023

    Hi,

    to Move Up:

    a!richTextIcon(
                          icon: "arrow-up",
                          link: a!dynamicLink(
                            saveInto: {
                              a!save(
                                ri!cdt,
                                a!update(
                                  ri!cdt,
                                  { local!index - 1, local!index },
                                  {
                                    fv!item,
                                    ri!cdt[max(local!index - 1, 1)]
                                  }
                                )
                              )
                            }
                          ),
                          showWhen: not(fv!isFirst)
                        )

    to Move Down:

                        a!richTextIcon(
                          icon: "arrow-down",
                          link: a!dynamicLink(
                            saveInto: {
                              a!save(
                                ri!cdt,
                                a!update(
                                  ri!cdt,
                                  { local!index + 1, local!index },
                                  { fv!item, ri!cdt[local!index + 1] }
                                )
                              )
                            }
                          ),
                          showWhen:not(fv!isLast)
                        )