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 Reply Children
  • 0
    Certified Lead Developer
    in reply to kavyanatrajan

    Yes.

    You might need to change the logic for the dynamic image a bit to work with the correct value.

  • 0
    Certified Senior Developer
    in reply to Stefan Helzle

    there are several issue not quite fine:

    • dynamiklink with value and saveInto which contains only an a!save
    • the if clauses with fv!item=1,
    • checking index(local!data,"active",{}),  but storing the date in a rule input
      a!gridImageColumn(
        label: "Active?",
        field: "active",
        data: {
          a!forEach(
            items: index(
              local!data,
              "active",
              {}
            ),
            expression: {
              a!documentImage(
                document: a!iconIndicator(
                  icon: "STATUS_OK"
                ),
                caption: "Yes",
                link: a!dynamicLink(
                  label: "change",
                  saveInto: {
                    a!save(
                      target:local!data[fv!index].active,
                      value: true
                    ),
                    /*bot sure if necerssary, depends on your construct*/
                    a!save(
                      target:ri!change[fv!index],
                      value: true
                    )
                  }
                ),
                showWhen: toboolean(fv!item)=true
              ),
              a!documentImage(
                document: a!iconIndicator(
                  icon: "STATUS_NOTDONE"
                ),
                caption: "No",
                link: a!dynamicLink(
                  label: "change",
                  saveInto: {
                    a!save(
                      target:local!data[fv!index].active,
                      value: false
                    ),
                    /*bot sure if necerssary, depends on your construct*/
                    a!save(
                      target:ri!change[fv!index],
                      value: false
                    )
                  }
                ),
                showWhen: toboolean(fv!item)=false
              )
            }
          )
        }
      )

      try this

      edit: sorry wrong person i replied to 
  • 0
    Certified Senior Developer
    in reply to Richard Michaelis

    Hi Richard,

    I am facing this error.

    Regards,

    Kavya

  • 0
    Certified Senior Developer
    in reply to Stefan Helzle

    The issue was to add pagination in editable grid. Since it is quite tricky and have disadvantages, we split the table to two. A grid field where the read only data from db is there and a editable grid below to add new data. So when the new user gets added it should check whether the user is active or not in the first table and also within the editable grid. If count of active user is greater than 1 it will throw error and ask user to change any one of the active so in grid field we need a option to change the active status. I have'nt coded for validation also. It is working within editable grid but not between 2 tables.