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
  • 0
    Certified Lead Developer

    Please post your code, at least the saveInto.

  • 0
    Certified Senior Developer
    in reply to Stefan Helzle

    a!gridImageColumn(
                      label: "Active?",
                      field: "active",
                      data: {
                        a!forEach(
                          items: index(
                            local!data,
                            "active",
                            {}
                          ),
                          expression: if(
                            fv!item = 1,
                            a!documentImage(
                              document: a!iconIndicator(
                                icon: "STATUS_OK"
                              ),
                              caption: "Yes",
                              link: a!dynamicLink(
                                label: "change",
                                value: if(
                                  fv!item = 1,
                                  false,
                                  true
                                ),
                                saveInto: a!save(
                                  ri!change,
                                  if(
                                    fv!item = 1,
                                    false,
                                    true
                                  )
                                )
                              )
                            ),
                            a!documentImage(
                              document: a!iconIndicator(
                                icon: "STATUS_NOTDONE"
                              ),
                              caption: "No",
                              link: a!dynamicLink(
                                label: "change",
                                value: if(
                                  fv!item = 1,
                                  false,
                                  true
                                ),
                                saveInto: a!save(
                                  ri!change,
                                  if(
                                    fv!item = 1,
                                    false,
                                    true
                                  )
                                )
                              )
                            )
                          )
                        )
                      }/*index(local!data,"active",{})*/
                      
                    )

    ri!change is a boolean variable I used for checking purpose. It was supposed to replace the value in local!data .

    Regards,

    Kavya

Reply
  • 0
    Certified Senior Developer
    in reply to Stefan Helzle

    a!gridImageColumn(
                      label: "Active?",
                      field: "active",
                      data: {
                        a!forEach(
                          items: index(
                            local!data,
                            "active",
                            {}
                          ),
                          expression: if(
                            fv!item = 1,
                            a!documentImage(
                              document: a!iconIndicator(
                                icon: "STATUS_OK"
                              ),
                              caption: "Yes",
                              link: a!dynamicLink(
                                label: "change",
                                value: if(
                                  fv!item = 1,
                                  false,
                                  true
                                ),
                                saveInto: a!save(
                                  ri!change,
                                  if(
                                    fv!item = 1,
                                    false,
                                    true
                                  )
                                )
                              )
                            ),
                            a!documentImage(
                              document: a!iconIndicator(
                                icon: "STATUS_NOTDONE"
                              ),
                              caption: "No",
                              link: a!dynamicLink(
                                label: "change",
                                value: if(
                                  fv!item = 1,
                                  false,
                                  true
                                ),
                                saveInto: a!save(
                                  ri!change,
                                  if(
                                    fv!item = 1,
                                    false,
                                    true
                                  )
                                )
                              )
                            )
                          )
                        )
                      }/*index(local!data,"active",{})*/
                      
                    )

    ri!change is a boolean variable I used for checking purpose. It was supposed to replace the value in local!data .

    Regards,

    Kavya

Children