Skip to main content
saahilm0001
July 10, 2021
Question

Selectables in read-only grid

  • July 10, 2021
  • 10 replies
  • 1 view

Hi All,

I am using selectables in read-only grid, based on the selected row I need to show a value in a particular column. In editable grid, we can configure the readonly as not(contains(ri!selectionList,fv!index)). But how to check whether the current row is in the selected list. How to get the row id in read-only grid?

10 replies

stefanhelzle0001
Brainy
July 10, 2021

Documentation says that the grid stores the ID.

https://docs.appian.com/suite/help/21.2/read-only-grid-configuration.html#selection

Something like this should do it. Copied you snippet.

not(contains(ri!selectionList,fv!row.id))

saahilm0001
July 10, 2021

Hi Stefan, actually in a paging grid, for data as a data subset, the data subset identifier gets stored as the selection value. 

I have a date column, which is initially not visible. But as soon as a row is selected the entire date column becomes visible and not only the specific row date. Any idea?

stefanhelzle0001
Brainy
July 10, 2021

Would need to see at least some code snippets. What is the field name of your primary key? That must be used in contains().

dastagirid756
July 12, 2021

I hope following code fragments helps you in saving code fragments.

/*Local variable declaration*/
...
local!selectedMappingId: tointeger({}),
...

/*To save a selected row id in the readonly grid*/
...
          selectionValue: local!selectedMappingId,
          selectionSaveInto: {
            a!save(
              local!selectedMappingId,
              save!value
            )
          }
...

/*To save the complete selected row and selected row id*/
...
          selectionValue: local!selectedMappingId,
          selectionSaveInto: {
            a!save(
              local!selectedRow,
                fv!selectedRows
            )
          }

...

/*To check whether the id is in the selected list. The usage of this varies on  your scenario */
...
wherecontains(sav!value,local!selectedMappingId)
...

saahilm0001
July 15, 2021

Hi,

Thanks for clearing this. [emoticon:c4563cd7d5574777a71c318021cbbcc8]