Multiple Dynamic Links in a single grid field

Hello,

We are working on an application that is reading json and placing individual elements in separate grid fields once the json is in a datasubset. In one of these grid fields, we have multiple bits of data returned displayed in a single row, and would like each of those bits of data rendered dynamically as separate links on distinct lines within the grid field. Is this possible?

 

So, for instance

Column Header 1 Column Header 2
Data 1

Data 1a

Data 1b

Data 1c

Data 2

Data 2a

Data 2b

Data 2c

Data 2d

 

Thanks,

Dylan

  Discussion posts and replies are publicly visible

Parents
  • Hello Dylan,

    The following code does the following:

    • Iterates an array of string to be displayed as links.
    • I displayed the information using a grid layout.

    This rule helps you to iterate and create a dynamic link for each description. 

    a!forEach(
      items: ri!descriptions,
      expression: a!dynamicLink(
        label: fv!item
      )
    )

    Interface:

    load(
      local!testList_cdt:{
        {id:1, description:{"Apple","Apricot","Avocado"}},
        {id:2, description:{"Banana","Blueberry"}}
      },
      a!formLayout(
        contents:{
          a!gridLayout(
            headerCells: {
              a!gridLayoutHeaderCell(label: "id"),
              a!gridLayoutHeaderCell(label: "description"),
            },
            columnConfigs: {
              a!gridLayoutColumnConfig(width:"DISTRIBUTE"),
              a!gridLayoutColumnConfig(width:"DISTRIBUTE"),
            },
            rows: a!forEach(
              items: local!testList_cdt,
              expression: a!gridRowLayout(
                id: index(fv!item,"id",null),
                contents: {
                  a!textField(
                    value: fv!item.id,
                    readOnly: true
                  ),
                  a!linkField(
                    links: rule!CreateLink(
                      descriptions: fv!item.description
                    )
                  )
                }
              )
            )
          )
        }
      )  
    )

    Hope the code attached helps you to resolve your query.

    Regards.

Reply
  • Hello Dylan,

    The following code does the following:

    • Iterates an array of string to be displayed as links.
    • I displayed the information using a grid layout.

    This rule helps you to iterate and create a dynamic link for each description. 

    a!forEach(
      items: ri!descriptions,
      expression: a!dynamicLink(
        label: fv!item
      )
    )

    Interface:

    load(
      local!testList_cdt:{
        {id:1, description:{"Apple","Apricot","Avocado"}},
        {id:2, description:{"Banana","Blueberry"}}
      },
      a!formLayout(
        contents:{
          a!gridLayout(
            headerCells: {
              a!gridLayoutHeaderCell(label: "id"),
              a!gridLayoutHeaderCell(label: "description"),
            },
            columnConfigs: {
              a!gridLayoutColumnConfig(width:"DISTRIBUTE"),
              a!gridLayoutColumnConfig(width:"DISTRIBUTE"),
            },
            rows: a!forEach(
              items: local!testList_cdt,
              expression: a!gridRowLayout(
                id: index(fv!item,"id",null),
                contents: {
                  a!textField(
                    value: fv!item.id,
                    readOnly: true
                  ),
                  a!linkField(
                    links: rule!CreateLink(
                      descriptions: fv!item.description
                    )
                  )
                }
              )
            )
          )
        }
      )  
    )

    Hope the code attached helps you to resolve your query.

    Regards.

Children
No Data