Expand/Collapse Rows in GridField

Hi All,

https://docs.appian.com/suite/help/17.1/recipe_expand_collapse_rows_in_a_tree_grid.html

I have gone through the above link for collapse option in grid view

what i found is the above code is in a!gridLayout() but i need the same logic in a!gridField()

i am having the previous code in a!gridField() I is possible?

i have tried it but i am not getting it properly 

can any one help me on this

  Discussion posts and replies are publicly visible

Parents Reply
  • Here's a sample based on what Mike is suggesting:

    a!localVariables(
      local!prs: {
        {id: 1, customer: "John Smith"},
        {id: 2, customer: "Jane Doe"},
        {id: 3, customer: "Tony Stark"}
      },
      local!items: {
        {id: 1, pr_id: 1, product: "Donuts"},
        {id: 2, pr_id: 1, product: "Chocolate"},
        {id: 3, pr_id: 1, product: "Potato Chips"},
        {id: 4, pr_id: 2, product: "Cookies"},
        {id: 5, pr_id: 2, product: "Ice Cream"},
        {id: 6, pr_id: 3, product: "Jellybeans"},
        {id: 7, pr_id: 3, product: "Cake"}
      },
      a!gridField(
        label: "Expandable Grid",
        data: local!prs,
        columns: {
          a!gridColumn(
            label: "ID",
            value: fv!row.id
          ),
          a!gridColumn(
            label: "Customer",
            value: fv!row.customer
          ),
          a!gridColumn(
            label: "Items",
            value: a!richTextDisplayField(
              value: a!localVariables(
                local!showDetails: false,
                if(
                  local!showDetails,
                  {
                    a!richTextBulletedList(
                      items:a!forEach(
                        items: index(
                          local!items,
                          wherecontains(
                            tointeger(fv!row.id),
                            tointeger(local!items.pr_id)
                          ),
                          {}
                        ),
                        expression: fv!item.product
                      )
                    ),
                    a!richTextItem(
                      text: "(Hide Details)",
                      link: a!dynamicLink(
                        value: false,
                        saveInto: local!showDetails
                      )
                    )
                  },
                  a!richTextItem(
                    text: "(Show Items)",
                    link: a!dynamicLink(
                      value: true,
                      saveInto: local!showDetails
                    )
                  )
                )
              )
            )
          )
        }
      )
    )

Children