Radio Buttons and Read Only Grid

Certified Senior Developer

Hi All,

Is it possible to have radio buttons in a grid column of a read only grid? 

Thanks in advance

  Discussion posts and replies are publicly visible

Parents Reply
  • 0
    Certified Lead Developer
    in reply to Maria

    a!localVariables(
      local!olderThan45: false,
      a!richTextDisplayField(
        label: "Radio Button",
        value: {
          a!richTextIcon(
            icon: if(local!olderThan45, "circle", "circle-o"),
            link: a!dynamicLink(
              value: true,
              saveInto: local!olderThan45
            ),
            linkStyle: "STANDALONE",
          ),
          a!richTextItem(
            text:" Yes",
            link: a!dynamicLink(
              value: true,
              saveInto: local!olderThan45
            ),
            linkStyle: "STANDALONE",
          ),
          char(10),
          a!richTextIcon(
            icon: if(local!olderThan45, "circle-o", "circle"),
            link: a!dynamicLink(
              value: false,
              saveInto: local!olderThan45
            ),
            linkStyle: "STANDALONE",
          ),
          a!richTextItem(
            text:" No",
            link: a!dynamicLink(
              value: false,
              saveInto: local!olderThan45
            ),
            linkStyle: "STANDALONE",
          ),
        }
      )
    )

Children
  • 0
    Certified Lead Developer
    in reply to Stefan Helzle

    I had this already written before I realized OP was not after row-by-row selection.  Pasting it here anyway as a pattern for others to use if needed.  I think it looks pretty decent and I only wish it were possible 5 or 6 years ago, lol.

    a!localVariables(
      
      local!gridData: a!forEach(
        enumerate(9),
        a!map(
          id: fv!index,
          name: "Row " & fv!index
        )
      ),
      
      local!selection: tointeger(null()),
      
      a!gridField(
        data: local!gridData,
        selectable: false(),
        
        columns: {
          a!gridColumn(
            helpTooltip: "Fake Selection Column",
            width: "ICON",
            align: "CENTER",
            value: a!richTextDisplayField(
              value: a!richTextItem(
                text: {
                  a!richTextIcon(
                    icon: "circle-o",
                    showWhen: local!selection <> fv!row.id,
                    size: "MEDIUM",
                    link: a!dynamicLink(
                      saveInto: {
                        a!save(
                          local!selection,
                          fv!row.id
                        )
                      }
                    ),
                    linkStyle: "STANDALONE",
                    caption: "Click to Select"
                  ),
                  a!richTextIcon(
                    icon: "dot-circle-o",
                    showWhen: local!selection = fv!row.id,
                    size: "MEDIUM",
                    color: "ACCENT",
                    caption: "Currently Selected"
                  )
                }
              )
            )
          ),
          
          a!gridColumn(
            label: "Id",
            value: fv!row.id
          ),
          a!gridColumn(
            label: "Name",
            value: fv!row.name
          )
        }
      )
    )