Skip to main content
jmg0001
New Participant
Aug 23, 2023 3:42 PM UTC
Question

Making an editable table row unselectable

Hi, all --

I am working on a mock-up with an editable table that is not hooked up to any database. I want to make one row unselectable while keeping the other rows able to be selected. Is there anything I can put in the expression to achieve this effect for UI purposes only?

Thanks. 

3 replies

mathieud0001
Genius
Aug 23, 2023 4:03 PM UTC

Did you try selectionDisabled in the gridRowLayout?

[View:https://docs.appian.com/suite/help/23.3/Grid_Row_Component.html]

jmg0001
jmg0001Author
New Participant
Aug 23, 2023 4:07 PM UTC

I am looking at this, Matt, but cannot see how it is structured in the expression. I am a designer not a developer.

Update: It appears this is for the whole table. What I am looking for is to disable one row on the table so it cannot be selected while leaving the rest of the table selectable.

mathieud0001
Genius
Aug 23, 2023 4:47 PM UTC

a!localVariables(
  local!selectedValue,
  
  local!data: {
    a!map(
      id: 1,
      name: "Mat",
      selectionDisabled: false
    ),
    a!map(
      id: 2,
      name: "Joe",
      selectionDisabled: true
    ),
    a!map(
      id: 3,
      name: "John",
      selectionDisabled: true
    )
  },
  a!gridLayout(
    label: "Editable Grid",
    labelPosition: "ABOVE",
    headerCells: {
      a!gridLayoutHeaderCell(label: "ID"),
      a!gridLayoutHeaderCell(label: "Name")
    },
    columnConfigs: {},
    rows: a!forEach(
      items: local!data,
      expression: a!gridRowLayout(
        selectionDisabled: fv!item.selectionDisabled,
        contents: {
        a!textField(
          value: fv!item.id,
          readOnly: true
        ),
        a!textField(
          value: fv!item.name,
          readOnly: true
        )
      }
      )
    ),
    selectable: true,
    shadeAlternateRows: true
  )
)