how to add multiple rows on one click of add row link in editable grid?

In the editable grid I want to add 2 rows on click of add row link, please help me out how to add dt ?

  Discussion posts and replies are publicly visible

  • 0
    Certified Lead Developer

    This should be about as easy as utilizing the standard "add row link" and having it add 2 new entries to the dictionary storing your row data.  Without more detail it's hard to say exactly what you'll need.  What have you tried so far and had difficulty with?

    Quick example:

    a!localVariables(
      local!rows: {
        {
          name: "row 1",
          id: 1
        }
      },
      
      a!gridLayout(
        headerCells: {
          a!gridLayoutHeaderCell(label: "name")
        },
        rows: a!forEach(
          local!rows,
          a!gridRowLayout(
            contents: {
              a!richTextDisplayField(
                value: fv!item.name
              )
            }
          )
        ),
        addRowLink: a!dynamicLink(
          label: "Add Row(s)",
          saveInto: {
            a!save(
              local!rows,
              append(
                local!rows,
                {
                  {
                    id: max(local!rows.id) + 1,
                    name: "row " & max(local!rows.id) + 1
                  },
                  {
                    id: max(local!rows.id) + 2,
                    name: "row " & max(local!rows.id) + 2
                  }
                }
              )
            )
          }
        )
      )
    )

  • I want to populate 2 rows.
    for 1 primary key, there are 2 language id's so in grid I have 2 columns one to add name, another to add description .
    So if I click add row link I want 2 rows to enter values for both language id's.

    I have tried forEach() for add row link but its not accepting list 

  • 0
    Certified Lead Developer
    in reply to anita

    Please post a code sample and relevant screenshots.