Editable Grid

Certified Lead Developer

Is there any way to remove select all checkbox in editable grid?
we have requirement to select 1 item at a time. there is grid validation of selecting 1 item at time.
it shows error but is there any way to not even allowing to check the select all checkbox?

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    You could also use an image field displaying a checkbox.

    load(
      local!data: {
        1,2,3
      },
      local!selectedIndex,
      a!gridLayout(
        label: "Editable Grid",
        labelPosition: "ABOVE",
        headerCells: {
          a!gridLayoutHeaderCell(label: ""),
          a!gridLayoutHeaderCell(label: "Data")
        },
        columnConfigs: {
          a!gridLayoutColumnConfig(width: "ICON"),
          a!gridLayoutColumnConfig(width: "DISTRIBUTE")
        },
        rows: a!forEach(
          items: local!data,
          expression: a!gridRowLayout(
            contents: {
              a!imageField(
                images: a!documentImage(
                  document: if(
                    fv!index = tointeger(local!selectedIndex),
                    cons!CHECKBOX_CHECKED,
                    cons!CHECKBOX
                  ),
                  link: a!dynamicLink(
                    saveInto: if(
                      tointeger(local!selectedIndex) = fv!index,
                      a!save(
                        target: local!selectedIndex,
                        value: null
                      ),
                      a!save(
                        target: local!selectedIndex,
                        value: fv!index
                      )
                    )
                  )
                )  
              ),
              a!textField(
                value: fv!item
              )
            }
          )
        )
      )
    )

Reply
  • 0
    Certified Lead Developer

    You could also use an image field displaying a checkbox.

    load(
      local!data: {
        1,2,3
      },
      local!selectedIndex,
      a!gridLayout(
        label: "Editable Grid",
        labelPosition: "ABOVE",
        headerCells: {
          a!gridLayoutHeaderCell(label: ""),
          a!gridLayoutHeaderCell(label: "Data")
        },
        columnConfigs: {
          a!gridLayoutColumnConfig(width: "ICON"),
          a!gridLayoutColumnConfig(width: "DISTRIBUTE")
        },
        rows: a!forEach(
          items: local!data,
          expression: a!gridRowLayout(
            contents: {
              a!imageField(
                images: a!documentImage(
                  document: if(
                    fv!index = tointeger(local!selectedIndex),
                    cons!CHECKBOX_CHECKED,
                    cons!CHECKBOX
                  ),
                  link: a!dynamicLink(
                    saveInto: if(
                      tointeger(local!selectedIndex) = fv!index,
                      a!save(
                        target: local!selectedIndex,
                        value: null
                      ),
                      a!save(
                        target: local!selectedIndex,
                        value: fv!index
                      )
                    )
                  )
                )  
              ),
              a!textField(
                value: fv!item
              )
            }
          )
        )
      )
    )

Children