Need help on read only grid

Certified Associate Developer

load(
  local!empStatus: {
    { name: "Ajay", status: "test1" },
    { name: "Ajay", status: "test2" },
    { name: "kumar", status: "test3" },
    { name: "phani", status: "test4" }
  },
  local!empDetail: {
    { name: "Ajay" },
    { name: "kumar" },
    { name: "phani" }
  },
  a!boxLayout(
    label: "Form",
    contents: {
      a!gridField(
        label: "grid",
        data: local!empDetail,
        pageSize: 5,
        pagingSaveInto: fv!pagingInfo,
        columns: {
          a!gridColumn(label: "Name", value: fv!row.name),
          a!gridColumn(
            label: "Status",
            value: a!forEach(
              items: local!empStatus,
              expression: fv!item.status
            )
          )
        }
      )
    }
  )
)

Hi All,

I have added the sample code and the output where I need to display the corresponding status for that particular name.

for example: Name: Ajay   Status should be Test1, Test2 and similarly

for                Name: Kumar Status should be Test3

and for         Name: Phani status should be Test4.

Thanks in advance,

Gousii.

  Discussion posts and replies are publicly visible

Parents
  • load(
      local!empStatus: {
        { name: "Ajay", status: "test1" },
        { name: "Ajay", status: "test2" },
        { name: "kumar", status: "test3" },
        { name: "phani", status: "test4" }
      },
      local!empDetail: {
        { name: "Ajay" },
        { name: "kumar" },
        { name: "phani" }
      },
      a!boxLayout(
        label: "Form",
        contents: {
          a!gridField(
            label: "grid",
            data: local!empDetail,
            pageSize: 5,
            pagingSaveInto: fv!pagingInfo,
            columns: {
              a!gridColumn(label: "Name", value: fv!row.name),
              a!gridColumn(
                label: "Status",
                value: joinarray(
                  index(
                    local!empStatus.status,
                    wherecontains(
                      fv!row.name,
                      touniformstring(local!empStatus.name)
                    ),
                    {}
                  ),
                  ","
                )
              )
            }
          )
        }
      )
    )

Reply
  • load(
      local!empStatus: {
        { name: "Ajay", status: "test1" },
        { name: "Ajay", status: "test2" },
        { name: "kumar", status: "test3" },
        { name: "phani", status: "test4" }
      },
      local!empDetail: {
        { name: "Ajay" },
        { name: "kumar" },
        { name: "phani" }
      },
      a!boxLayout(
        label: "Form",
        contents: {
          a!gridField(
            label: "grid",
            data: local!empDetail,
            pageSize: 5,
            pagingSaveInto: fv!pagingInfo,
            columns: {
              a!gridColumn(label: "Name", value: fv!row.name),
              a!gridColumn(
                label: "Status",
                value: joinarray(
                  index(
                    local!empStatus.status,
                    wherecontains(
                      fv!row.name,
                      touniformstring(local!empStatus.name)
                    ),
                    {}
                  ),
                  ","
                )
              )
            }
          )
        }
      )
    )

Children