add row in inline grid with other data as read only

Team,

I have a requirement where data is coming from database and appearing in editable grid all components in grid have read only set to true , i am using dynamic link to delete and add row.

Delete is fine but when i click on add new row , all fields are read only . I want the new added row to be editable and above one's as read only (with required true in it)

Please suggest

  Discussion posts and replies are publicly visible

Parents Reply
  • Totally correct sir!  That was a quick-and-dirty Slight smile

    a!localVariables(
      local!data: {
        {id: 1, field: "test1"},
        {id: 2, field: "test2"}
      },
      a!gridLayout(
        headerCells: {a!gridLayoutHeaderCell(label: "Test")},
        totalCount: count(local!data),
        rows: a!forEach(
          items: local!data,
          expression: a!gridRowLayout(
            id: fv!index,
            contents: {
              a!textField(
                value: fv!item.field,
                saveInto: fv!item.field,
                readOnly: not(isnull(fv!item.id))
              )
            }
          )
        ),
        addRowLink: aa!dynamicLink(
          label: "Add Row",
          value: {},
          saveInto: a!save(local!data,append(local!data,{id: null, field: null}))
        )
      )
    )

Children
No Data