Grid field to have a change in variable.

Certified Senior Developer

Hi guys,

I am having a grid where a set of data will be on display. In a column I have used Icon indicator and a dynamic link. When I click it should change from true to false or false to true and the respective icon sholud change in the grid. Any solution for that. I have tried some ways but in the save option of dynamic link I am struck. Thanks in Advance.

Regards,

Kavya

  Discussion posts and replies are publicly visible

Parents
  • +1
    Certified Lead Developer

    Hi Kavya, 

    You can try an approach like this

    If you need, you can also save into ri!change according to its structure / type

    a!localVariables(
      local!paging: a!pagingInfo(1, 10),
      local!data: { { active: true() }, { active: false() } },
      a!gridField_19r1(
        /*use a!gridField() if you are on 19.1 version*/
        value: local!paging,
        totalCount: count(local!data),
        columns: {
          a!gridImageColumn(
            label: "Active?",
            field: "active",
            data: a!forEach(
              items: index(local!data, "active", {}),
              expression: a!localVariables(
                local!change: toboolean(fv!item),
                a!documentImage(
                  document: a!iconIndicator(
                    icon: if(
                      local!change,
                      "STATUS_OK",
                      "STATUS_NOTDONE"
                    )
                  ),
                  caption: if(local!change, "Yes", "No"),
                  link: a!dynamicLink(
                    label: "change",
                    value: not(local!change),
                    saveInto: { local!change }
                  )
                )
              )
            )
          )
        }
      )
    )

  • 0
    Certified Senior Developer
    in reply to agam

    Thank you Its working.

Reply Children
No Data