Best approach to display 4000 characters in a!GridField

I have a grid field containing comments, where 1 of the fields could hold upto 4000 characters.

When the length is 4000, then text display is not user friendly.

I tried using a!richtextimage to display the comments on hover over but icon display only upto 1000 length etc and rest shown as(sampletext...) trunc.

I do not want to use a different interface to display the comment alone from Grid.

Any suggestions?

a!gridField(
  data: ri!data,
  label: "Comments",
  labelPosition: "COLLAPSED",
  totalCount: ri!data.totalCount,
  columns: {
    a!gridColumn(
      label: "Comment Type",
      sortField: "commentType",
      value: fv!row.commentTypeId
    ),
    a!gridColumn(
      label: "Commented By",
      sortField: "createdBy",
      value: rule!ACO_replaceNull(
        fv!row.createdBy,
        fv!row.createdBy
      )
    ),
    a!gridColumn(
      label: "Commented On",
      sortField: "createdDt",
      value: rule!ACO_replaceNull(
        fv!row.createdDt,
        fv!row.createdBy
      )
    ),
    a!gridColumn(
      label: "Comment",
      sortField: "comment",
      value: a!richTextDisplayField(
        value: a!richTextItem(
          text: fv!row.commentValue
        )
      )
    ),
    a!gridColumn(
      label: "Comment",
      align: "CENTER",
      value: a!richTextDisplayField(
        value: a!richTextIcon(
          icon: "comments",
          caption: fv!row.commentValue
        )
      )
    ),
    a!gridColumn(
      label: "Comment",
      align: "CENTER",
      value: ""
      
    ),
    a!gridColumn(
      label: "User(s) Tagged",
      sortField: "tags",
      value: a!forEach(
        items: if(
          rule!ACO_isEmpty(
            fv!row.emailTags
          ),
          null,
          trim(
            split(
              fv!row.emailTags,
              ";"
            )
          )
        ),
        expression: concat(
          user(
            fv!item,
            "firstName"
          ),
          " ",
          user(
            fv!item,
            "lastName"
          )
        )
      )
    )
  },
  value: ri!pagingInfo,
  showWhen: ri!showWhen,
  pagingSaveInto: ri!pagingInfo
)

  Discussion posts and replies are publicly visible

Parents
  • Here we put a "Read more" link at the top of the grid. When the user clicks it, it shows the full text for all the rows and columns.
    When the text is not expanded, we just trim it at a maximum size and put the "..." at the end.

    This can be done using only one variable local!isGridExpanded and whenever the variable changes (by clicking the link), the function that trims the text will be refreshed by Appian itself showing or hiding the whole text.

    Hope it helps.

Reply
  • Here we put a "Read more" link at the top of the grid. When the user clicks it, it shows the full text for all the rows and columns.
    When the text is not expanded, we just trim it at a maximum size and put the "..." at the end.

    This can be done using only one variable local!isGridExpanded and whenever the variable changes (by clicking the link), the function that trims the text will be refreshed by Appian itself showing or hiding the whole text.

    Hope it helps.

Children