Is there a possible way to add rownum column in readonly grid?

Certified Associate Developer

Hello,

Is there a possible way to add rownum column in readonly grid?

If possible, it would be appreciated if you could attach an example for reference.

Thank you.

  Discussion posts and replies are publicly visible

Parents Reply Children
  • 0
    Certified Associate Developer
    in reply to Stefan Helzle

    enumerated value shows up in th e read-only grid lik [ 1; 2; 3; ].

    How can I make it show one number for each row?

    (Data source for the read-only grid is record type.)

  • 0
    Certified Senior Developer
    in reply to dreamyoung

    do you have your code available to post it here? its easier to correct than a picture. but i seems like you are inserting the local instead of fv!row/fv!Item

  • 0
    Certified Lead Developer
    in reply to dreamyoung

    While this is becoming complicated and I really suggest to push back this requirement, an option might be to update the identifiers field of your datasubset to the above mentioned enumeration. Then you can just use fv!identifier.

    Check this untested code you will have to adapt to your needs.

    a!update(local!yourDatasubset, "identifiers", local!pagingInfo.startIndex + enumerate(local!pagingInfo.batchSize))

    a!localVariables(
      local!pInfo: a!pagingInfo(10, 10),
      local!data: a!dataSubset(
        startIndex: local!pInfo.startIndex,
        batchSize: local!pInfo.batchSize,
        totalCount: 100,
        data: a!forEach(
          items: enumerate(10),
          expression: a!map(value: char(fv!index + 60))
        ),
      ),
      {
        a!gridField(
          label: "Read-only Grid",
          labelPosition: "ABOVE",
          data: a!update(
            data: local!data,
            index: "identifiers",
            value: local!data.startIndex + enumerate(local!data.batchSize)
          ),
          pagingSaveInto: local!pInfo,
          columns: {
            a!gridColumn(
              label: "Grid Column",
              value: fv!identifier
            ),
            a!gridColumn(
              label: "Grid Column",
              value: fv!row.value
            ),
          },
          validations: {}
        )
      }
    )