add checkbox in a column of editable grid

I want a column in an editable grid where I have checkboxes for every cell in that column. User can select yes or no option

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Senior Developer

    Hi, you can configure the grid like below

    a!localVariables(
      local!data:{
        a!map(
          name: null, tier: null
        )
      },
      {
      a!gridLayout(
        label: "Editable Grid",
        labelPosition: "ABOVE",
        headerCells: {
          a!gridLayoutHeaderCell(label: "Name"),
          a!gridLayoutHeaderCell(label: "Choice")
        },
        columnConfigs: {
          a!gridLayoutColumnConfig(
            width: "NARROW"
          )
        },
        rows: {
          a!forEach(
            items: local!data,
            expression: a!gridRowLayout(
              contents: {
                a!textField(
                  label: "Name",
                  value: fv!item.name,
                  saveInto: fv!item.name
                ),
                a!checkboxField(
                  label: "Check box",
                  value: fv!item.tier,
                  saveInto: fv!item.tier,
                  choiceLabels: {1,2,3},
                  choiceValues: {1,2,3}
                )
              }
              
            )
          )
        },
        addRowLink: a!dynamicLink(
          label: "Add New Customer",
          saveInto: {
            a!save(local!data,
            append(local!data, local!data))
          }
        ),
        selectionSaveInto: {},
        validations: {},
        shadeAlternateRows: true
      )
    }
    )

Reply
  • 0
    Certified Senior Developer

    Hi, you can configure the grid like below

    a!localVariables(
      local!data:{
        a!map(
          name: null, tier: null
        )
      },
      {
      a!gridLayout(
        label: "Editable Grid",
        labelPosition: "ABOVE",
        headerCells: {
          a!gridLayoutHeaderCell(label: "Name"),
          a!gridLayoutHeaderCell(label: "Choice")
        },
        columnConfigs: {
          a!gridLayoutColumnConfig(
            width: "NARROW"
          )
        },
        rows: {
          a!forEach(
            items: local!data,
            expression: a!gridRowLayout(
              contents: {
                a!textField(
                  label: "Name",
                  value: fv!item.name,
                  saveInto: fv!item.name
                ),
                a!checkboxField(
                  label: "Check box",
                  value: fv!item.tier,
                  saveInto: fv!item.tier,
                  choiceLabels: {1,2,3},
                  choiceValues: {1,2,3}
                )
              }
              
            )
          )
        },
        addRowLink: a!dynamicLink(
          label: "Add New Customer",
          saveInto: {
            a!save(local!data,
            append(local!data, local!data))
          }
        ),
        selectionSaveInto: {},
        validations: {},
        shadeAlternateRows: true
      )
    }
    )

Children
No Data